You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KAFKA-20379 ducker-ak has no option to skip the gradlew systemTestLibs build step (#22034)
This PR adds an option to skip the gradle build while running system
tests.
#### Why
Add --skip-build support to ducker-ak test. Currently when someone wants
to skip the build it (e.g., it is already builded in the CI) it cannot
be skip because:
https://github.com/apache/kafka/blob/acd37fc30c5fdbbae772144c73b4f2c7e1c21d27/tests/docker/ducker-ak#L607
is always called in the `ducker_test` method in the script.
#### Tested
1. SKIP_BUILD=true ./tests/docker/ducker-ak test
./tests/kafkatest/tests/core/produce_bench_test.py => build is skipped
2. ./tests/docker/ducker-ak test
./tests/kafkatest/tests/core/produce_bench_test.py => build is NOT
skipped
3. ./tests/docker/ducker-ak test --skip-build
./tests/kafkatest/tests/core/produce_bench_test.py => build is skipped
4. SKIP_BUILD=true ./tests/docker/run_tests.sh => build is skipped
5. ./tests/docker/run_tests.sh => build is NOT skipped
6. ... (more)
Again as previous `--memory` option, `--skip-build` option has same
priority (i.e., CLI > ENV > default option).
Reviewers: Federico Valeri <fedevaleri@gmail.com>, Chia-Ping Tsai
<chia7712@gmail.com>
die "ducker_test: the ducker01 instance appears to be down. Did you run 'ducker up'?"
581
596
declare -a test_name_args=()
582
597
local debug=0
598
+
local skip_build="${SKIP_BUILD:-}"
599
+
local clean_build="${CLEAN_BUILD:-}"
583
600
while [[ $#-ge 1 ]];do
584
601
case"${1}"in
585
602
-d|--debug) debug=1;shift;;
603
+
-s|--skip-build) skip_build=true;shift;;
604
+
-c|--clean-build) clean_build=true;shift;;
586
605
--) shift;break;;
587
606
*) test_name_args+=("${1}");shift;;
588
607
esac
@@ -603,9 +622,17 @@ ducker_test() {
603
622
fi
604
623
done
605
624
606
-
must_pushd "${kafka_dir}"
607
-
( (test -f ./gradlew || gradle) && ./gradlew systemTestLibs ) || die "ducker_test: Failed to build system test libraries, please check the error log."
608
-
must_popd
625
+
if [[ "${skip_build}"=="true" ]];then
626
+
echo"ducker_test: skipping gradle build (--skip-build or SKIP_BUILD is set)."
627
+
elif [[ "${clean_build}"=="true" ]];then
628
+
must_pushd "${kafka_dir}"
629
+
( (test -f ./gradlew || gradle) && ./gradlew clean systemTestLibs ) || die "ducker_test: Failed to build system test libraries, please check the error log."
630
+
must_popd
631
+
else
632
+
must_pushd "${kafka_dir}"
633
+
( (test -f ./gradlew || gradle) && ./gradlew systemTestLibs ) || die "ducker_test: Failed to build system test libraries, please check the error log."
634
+
must_popd
635
+
fi
609
636
if [[ "${debug}"-eq 1 ]];then
610
637
local ducktape_cmd="python3 -m debugpy --listen 0.0.0.0:${debugpy_port} --wait-for-client /usr/local/bin/ducktape"
0 commit comments