Skip to content

Commit

Permalink
chore: force update snapshot when releasing or doing e2e tests (#556)
Browse files Browse the repository at this point in the history
Signed-off-by: Curtis Wan <[email protected]>
  • Loading branch information
mooc9988 authored Dec 14, 2023
1 parent 59c6044 commit f14dad1
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Build TarGz
run: |
./gradlew --build-cache releaseTarGz
./gradlew --build-cache --refresh-dependencies clean releaseTarGz
# docker image release
- name: Cp TarGz to Docker Path
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Build TarGz
run: |
./gradlew --build-cache releaseTarGz
./gradlew --build-cache --refresh-dependencies clean releaseTarGz
- name: GitHub Release
uses: softprops/action-gh-release@v1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
env:
TC_GENERAL_MIRROR_URL: "mirrors.ustc.edu.cn"
ESK_TEST_YML: "tests/kos_test_suite.yml"
DUCKER_TEST_OPTIONS: "-f"
# fail fast
# _DUCKTAPE_OPTIONS: "--exit-first"
steps:
Expand Down
5 changes: 5 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ ESK_TEST_YML="tests/esk_test_suite.yml" bash tests/docker/run_tests.sh
```
All included or excluded E2E tests can be found in `tests/esk_test_suite.yml` file.
* Force update dependencies and run AutoMQ for Apache Kafka E2E tests:
```
ESK_TEST_YML="tests/esk_test_suite.yml" DUCKER_TEST_OPTIONS="-f" bash tests/docker/run_tests.sh
```
* Notes
- The scripts to run tests creates and destroys docker network named *knw*.
This network can't be used for any other purpose.
Expand Down
8 changes: 7 additions & 1 deletion tests/docker/ducker-ak
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,11 @@ ducker_test() {
die "ducker_test: the ducker01 instance appears to be down. Did you run 'ducker up'?"
declare -a test_name_args=()
local debug=0
local force_update_snapshot=0
while [[ $# -ge 1 ]]; do
case "${1}" in
-d|--debug) debug=1; shift;;
-f|--force-update-snapshot) force_update_snapshot=1; shift;;
--) shift; break;;
*) test_name_args+=("${1}"); shift;;
esac
Expand All @@ -509,7 +511,11 @@ ducker_test() {
done

must_pushd "${kafka_dir}"
(test -f ./gradlew || gradle) && ./gradlew systemTestLibs
if [[ "${force_update_snapshot}" -eq 1 ]]; then
(test -f ./gradlew || gradle) && ./gradlew --refresh-dependencies clean systemTestLibs
else
(test -f ./gradlew || gradle) && ./gradlew systemTestLibs
fi
must_popd
if [[ "${debug}" -eq 1 ]]; then
local ducktape_cmd="python3 -m debugpy --listen 0.0.0.0:${debugpy_port} --wait-for-client /usr/local/bin/ducktape"
Expand Down
7 changes: 6 additions & 1 deletion tests/docker/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ TC_PATHS=${TC_PATHS:-${ESK_TEST_YML:-./kafkatest/}}
TC_GENERAL_MIRROR_URL=${TC_GENERAL_MIRROR_URL:-""}
TC_BASE_IMAGE=${TC_BASE_IMAGE:-"automqinc/kos_e2e_base:3.4.0"}
REBUILD=${REBUILD:f}
DUCKER_TEST_OPTIONS=${DUCKER_TEST_OPTIONS:-""}

die() {
echo $@
Expand All @@ -41,4 +42,8 @@ fi

[[ -n ${_DUCKTAPE_OPTIONS} ]] && _DUCKTAPE_OPTIONS="-- ${_DUCKTAPE_OPTIONS}"

${SCRIPT_DIR}/ducker-ak test ${TC_PATHS} ${_DUCKTAPE_OPTIONS} || die "ducker-ak test failed"
if [ -n "${DUCKER_TEST_OPTIONS}" ]; then
${SCRIPT_DIR}/ducker-ak test "${DUCKER_TEST_OPTIONS}" ${TC_PATHS} ${_DUCKTAPE_OPTIONS} || die "ducker-ak test failed"
else
${SCRIPT_DIR}/ducker-ak test ${TC_PATHS} ${_DUCKTAPE_OPTIONS} || die "ducker-ak test failed"
fi

0 comments on commit f14dad1

Please sign in to comment.