diff --git a/Makefile b/Makefile index d484226b554..dfdfed8c94d 100644 --- a/Makefile +++ b/Makefile @@ -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)" diff --git a/deployments/ticdc/docker-compose/docker-compose-kafka-integration.yml b/deployments/ticdc/docker-compose/docker-compose-kafka-integration.yml index 6f31f11d608..ccf9297bb8f 100644 --- a/deployments/ticdc/docker-compose/docker-compose-kafka-integration.yml +++ b/deployments/ticdc/docker-compose/docker-compose-kafka-integration.yml @@ -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 diff --git a/deployments/ticdc/docker-compose/docker-compose-mysql-integration.yml b/deployments/ticdc/docker-compose/docker-compose-mysql-integration.yml index f68a3696aa0..cacabd59cb3 100644 --- a/deployments/ticdc/docker-compose/docker-compose-mysql-integration.yml +++ b/deployments/ticdc/docker-compose/docker-compose-mysql-integration.yml @@ -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 diff --git a/tests/integration_tests/README.md b/tests/integration_tests/README.md index 67eb5992405..6152d6b7db1 100644 --- a/tests/integration_tests/README.md +++ b/tests/integration_tests/README.md @@ -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). @@ -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` diff --git a/tests/integration_tests/run.sh b/tests/integration_tests/run.sh index b42b8ea9a36..d8aa5c820f5 100755 --- a/tests/integration_tests/run.sh +++ b/tests/integration_tests/run.sh @@ -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