risingwavelabs / risingwave

Best-in-class stream processing, analytics, and management. Perform continuous analytics, or build event-driven applications, real-time ETL pipelines, and feature stores in minutes. Unified streaming and batch. PostgreSQL compatible.
https://go.risingwave.com/slack
Apache License 2.0
6.78k stars 561 forks source link

feat: integrated regress-test into risedev tools #13255

Open thexiay opened 10 months ago

thexiay commented 10 months ago

Is your feature request related to a problem? Please describe.

Is there any way to test regress test in risedev tools? For example, if i issue a pull request,i found my regress test fail, is there a quick and easy way to verify it locally? For now,if i want to regress test locally, i should do this,

pg regress test

# 1. build risingwave_regress_test(default debug mode)
cargo build -p risingwave_regress_test
# 2. manual lanuch postgres in docker
docker run -d \
  --name pgsqlserver \
  -p 5432:5432 \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_INITDB_ARGS="--encoding=UTF-8 --lc-collate=C --lc-ctype=C" \
  postgres:15-alpine \
  postgres -c wal_level=logical
# 3. prepare (dpkg-reconfigure dependes on debian or ubuntu system)
locale-gen C
export LANGUAGE=C
export LANG=C
export LC_ALL=C
export LC_COLLATE=C
locale-gen C
dpkg-reconfigure --frontend=noninteractive locales
export PGPASSWORD='postgres';
export PGSERVERHOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pgsqlserver) 
# 4. start regress test
rm -rf `pwd`/src/tests/regress/output
RUST_BACKTRACE=1 target/debug/risingwave_regress_test --host ${PGSERVERHOST} \
  -p 5432 \
  -u postgres \
  --database postgres \
  --input `pwd`/src/tests/regress/data \
  --output `pwd`/src/tests/regress/output \
  --schedule `pwd`/src/tests/regress/data/schedule \
  --mode postgres

risingwave regress test

# 1. build risingwave_regress_test(default debug mode)
cargo build -p risingwave_regress_test
# 2. manual lanuch postgres in docker
./risedev ci-start ci-3cn-1fe
# 3. prepare (dpkg-reconfigure dependes on debian or ubuntu system)
locale-gen C
export LANGUAGE=C
export LANG=C
export LC_ALL=C
export LC_COLLATE=C
locale-gen C
dpkg-reconfigure --frontend=noninteractive locales
# 4. start regress test
rm -rf `pwd`/src/tests/regress/output
RUST_BACKTRACE=1 target/debug/risingwave_regress_test --host 127.0.0.1 \
  -p 4566 \
  -u root \
  --input `pwd`/src/tests/regress/data \
  --output `pwd`/src/tests/regress/output \
  --schedule `pwd`/src/tests/regress/data/schedule \
  --mode risingwave

I think there must be another easier way to integrated it into risedev tools,just like: ./risedev regress-test array ./risedev regress-test boolean varchar text int2 int4 int8 float4 float8 comments

I hope to hear your suggestions or other better ways.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

thexiay commented 10 months ago

Here is this test tool workflow:

1. Prepare test env

for test pg:

./risedev ci-start pg

for test risingwave:

./risedev ci-start ci-3cn-1fe

I will add a template configuration for start a pgserver . The meaning of long parameters: --mode:test target. Moreover,it can be optional, it will automatically detect whether the environment starts pg or risingwave to read different configurations --test:schedule test

2. Do regress test

for pg:

./risedev do-regress-test --mode pg --test array binary

for risingwave

./risedev do-regress-test --mode risingwave --test array binary

Either output the test result to screen or output to a directory is all ok.

3. teardown test env

./risedev down
thexiay commented 10 months ago

Why here use local mode to start dependcy compoment like grafana,minio,kafka but not in docker? It's easily affected by the environment and we will not debug or change those dependent components code.😕

github-actions[bot] commented 3 months ago

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.