Skip to content

Commit

Permalink
feat(ci): run e2e tests against postgres/mysql backends on demand (#1…
Browse files Browse the repository at this point in the history
…9152)

Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao authored Oct 29, 2024
1 parent 55d42c8 commit 51a70d8
Show file tree
Hide file tree
Showing 5 changed files with 170 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ labels:
- label: "ci/run-e2e-single-node-tests"
files:
- "src\\/meta\\/.*.rs"

- label: "ci/run-e2e-test-other-backends"
files:
- "src\\/meta\\/.*.rs"
8 changes: 8 additions & 0 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ services:
volumes:
- ..:/risingwave

pg-mysql-backend-test-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240911
depends_on:
- mysql
- db
volumes:
- ..:/risingwave

ci-flamegraph-env:
image: public.ecr.aws/w1p7b4n3/rw-build-env:v20240911
# NOTE(kwannoel): This is used in order to permit
Expand Down
7 changes: 7 additions & 0 deletions ci/scripts/run-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ cluster_start() {
# Give it a while to make sure the single-node is ready.
sleep 10
else
# Initialize backends.
if [[ $mode == *"mysql-backend" ]]; then
mysql -h mysql -P 3306 -u root -p123456 -e "DROP DATABASE IF EXISTS metadata; CREATE DATABASE metadata;"
elif [[ $mode == *"pg-backend" ]]; then
PGPASSWORD=postgres psql -h db -p 5432 -U postgres -c "DROP DATABASE IF EXISTS metadata;" -c "CREATE DATABASE metadata;"
fi

risedev ci-start "$mode"
fi
}
Expand Down
34 changes: 34 additions & 0 deletions ci/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,40 @@ steps:
timeout_in_minutes: 30
retry: *auto-retry

- label: "end-to-end test (postgres backend)"
command: "ci/scripts/e2e-test.sh -p ci-dev -m ci-3streaming-2serving-3fe-pg-backend"
if: build.pull_request.labels includes "ci/run-e2e-test-other-backends" || build.env("CI_STEPS") =~ /(^|,)e2e-test-other-backends?(,|$$)/
depends_on:
- "build"
- "build-other"
- "docslt"
plugins:
- docker-compose#v5.1.0:
run: pg-mysql-backend-test-env
config: ci/docker-compose.yml
mount-buildkite-agent: true
- ./ci/plugins/upload-failure-logs
timeout_in_minutes: 30
retry: *auto-retry

- label: "end-to-end test (mysql backend)"
command: "ci/scripts/e2e-test.sh -p ci-dev -m ci-3streaming-2serving-3fe-mysql-backend"
if: "false"
# TODO: enable this when all bugs of mysql backend are addressed.
# if: build.pull_request.labels includes "ci/run-e2e-test-other-backends" || build.env("CI_STEPS") =~ /(^|,)e2e-test-other-backends?(,|$$)/
depends_on:
- "build"
- "build-other"
- "docslt"
plugins:
- docker-compose#v5.1.0:
run: pg-mysql-backend-test-env
config: ci/docker-compose.yml
mount-buildkite-agent: true
- ./ci/plugins/upload-failure-logs
timeout_in_minutes: 30
retry: *auto-retry

# FIXME(kwannoel): Let the github PR labeller label it, if sqlsmith source files has changes.
- label: "fuzz test"
command: "ci/scripts/pr-fuzz-test.sh -p ci-dev"
Expand Down
118 changes: 117 additions & 1 deletion risedev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ profile:
# - use: grafana # visualization

- use: meta-node
# - meta-backend: postgres
# meta-backend: postgres
- use: compute-node
- use: frontend

Expand Down Expand Up @@ -823,6 +823,122 @@ profile:
health-check-port: 6788
- use: compactor

ci-3streaming-2serving-3fe-pg-backend:
config-path: src/config/ci.toml
steps:
- use: minio
- use: postgres
port: 5432
address: db
database: metadata
user: postgres
password: postgres
user-managed: true
application: metastore
- use: meta-node
meta-backend: postgres
- use: compute-node
port: 5687
exporter-port: 1222
enable-tiered-cache: true
role: streaming
parallelism: 4
- use: compute-node
port: 5688
exporter-port: 1223
enable-tiered-cache: true
role: streaming
parallelism: 4
- use: compute-node
port: 5689
exporter-port: 1224
enable-tiered-cache: true
role: streaming
parallelism: 4
- use: compute-node
port: 5685
exporter-port: 1225
enable-tiered-cache: true
role: serving
parallelism: 4
- use: compute-node
port: 5686
exporter-port: 1226
enable-tiered-cache: true
role: serving
parallelism: 8
- use: frontend
port: 4565
exporter-port: 2222
health-check-port: 6786
- use: frontend
port: 4566
exporter-port: 2223
health-check-port: 6787
- use: frontend
port: 4567
exporter-port: 2224
health-check-port: 6788
- use: compactor

ci-3streaming-2serving-3fe-mysql-backend:
config-path: src/config/ci.toml
steps:
- use: minio
- use: mysql
port: 3306
address: mysql
database: metadata
user: root
password: 123456
user-managed: true
application: metastore
- use: meta-node
meta-backend: mysql
- use: compute-node
port: 5687
exporter-port: 1222
enable-tiered-cache: true
role: streaming
parallelism: 4
- use: compute-node
port: 5688
exporter-port: 1223
enable-tiered-cache: true
role: streaming
parallelism: 4
- use: compute-node
port: 5689
exporter-port: 1224
enable-tiered-cache: true
role: streaming
parallelism: 4
- use: compute-node
port: 5685
exporter-port: 1225
enable-tiered-cache: true
role: serving
parallelism: 4
- use: compute-node
port: 5686
exporter-port: 1226
enable-tiered-cache: true
role: serving
parallelism: 8
- use: frontend
port: 4565
exporter-port: 2222
health-check-port: 6786
- use: frontend
port: 4566
exporter-port: 2223
health-check-port: 6787
- use: frontend
port: 4567
exporter-port: 2224
health-check-port: 6788
- use: compactor

ci-kafka:
config-path: src/config/ci.toml
steps:
Expand Down

0 comments on commit 51a70d8

Please sign in to comment.