Skip to content

Commit

Permalink
scripts(ticdc): add a parameter to continue integration test (#4242)
Browse files Browse the repository at this point in the history
ref #3881
  • Loading branch information
sdojjy authored Jan 8, 2022
1 parent 952a874 commit abefe57
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ integration_test_build: check_failpoint_ctl
integration_test: integration_test_mysql

integration_test_mysql:
tests/integration_tests/run.sh mysql "$(CASE)"
tests/integration_tests/run.sh mysql "$(CASE)" "$(START_AT)"

integration_test_kafka: check_third_party_binary
tests/integration_tests/run.sh kafka "$(CASE)"
tests/integration_tests/run.sh kafka "$(CASE)" "$(START_AT)"

fmt: tools/bin/gofumports tools/bin/shfmt
@echo "gofmt (simplify)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ services:
command:
- bash
- -c
- make integration_test_kafka CASE="${CASE}" & tail -f /dev/null
- make integration_test_kafka CASE="${CASE}" START_AT="${START_AT}" & tail -f /dev/null
network_mode: "service:kafka"
volumes:
- ./logs/tidb_cdc_test:/tmp/tidb_cdc_test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ services:
command:
- bash
- -c
- make integration_test_mysql CASE="${CASE}" & tail -f /dev/null
- make integration_test_mysql CASE="${CASE}" START_AT="${START_AT}" & tail -f /dev/null
volumes:
- ./logs/tidb_cdc_test:/tmp/tidb_cdc_test
4 changes: 3 additions & 1 deletion tests/integration_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ We recommend that you provide docker with at least 6+ cores and 8G+ memory. Of c
2. Execute `tests/integration_tests/run.sh`

> If want to run one integration test case only, just pass the CASE parameter, such as `make integration_test CASE=simple`.
> If want to run integration test cases from the specified one, just pass the START_AT parameter, such as `make integration_test START_AT=simple` .
> There exists some environment variables that you can set by yourself, variable details can be found in [test_prepare](_utils/test_prepare).
Expand All @@ -76,7 +78,7 @@ We recommend that you provide docker with at least 6+ cores and 8G+ memory. Of c
> We will try to resolve these issues as soon as possible.
1. If you want to run kafka tests,
run `CASE="clustered_index" docker-compose -f ./deployments/ticdc/docker-compose/docker-compose-kafka-integration.yml up --build`
run `START_AT="clustered_index" docker-compose -f ./deployments/ticdc/docker-compose/docker-compose-kafka-integration.yml up --build`

2. If you want to run MySQL tests,
run `CASE="clustered_index" docker-compose -f ./deployments/ticdc/docker-compose/docker-compose-mysql-integration.yml up --build`
Expand Down
14 changes: 13 additions & 1 deletion tests/integration_tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,24 @@ test_case=$2
if [ -z "$test_case" ]; then
test_case="*"
fi

start_at=$3
run_test="no"
if [ -z "$start_at" ]; then
run_test="yes"
else
test_case="*"
fi

set -eu

if [ "$test_case" == "*" ]; then
for script in $CUR/*/run.sh; do
test_name="$(basename "$(dirname "$script")")"
run_case $test_name $script $sink_type
if [ "$run_test" == "yes" ] || [ "$start_at" == "$test_name" ]; then
run_test="yes"
run_case $test_name $script $sink_type
fi
done
else
for name in $test_case; do
Expand Down

0 comments on commit abefe57

Please sign in to comment.