Skip to content

Commit

Permalink
Fix: fix testcases_run.sh for upgrade tests
Browse files Browse the repository at this point in the history
Need to git checkout ${CI_COMMIT_SHA} before running upgrade playbook (revert kubernetes-sigs#11173 partially)
  • Loading branch information
tmurakam committed Aug 29, 2024
1 parent c89ea7e commit 89db882
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tests/scripts/testcases_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ if [[ "$CI_JOB_NAME" =~ "opensuse" ]]; then
fi

# Check out latest tag if testing upgrade
test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout "$KUBESPRAY_VERSION"
# Checkout the CI vars file so it is available
test "${UPGRADE_TEST}" != "false" && git checkout "${CI_COMMIT_SHA}" tests/files/${CI_JOB_NAME}.yml
test "${UPGRADE_TEST}" != "false" && git checkout "${CI_COMMIT_SHA}" ${CI_TEST_REGISTRY_MIRROR}
test "${UPGRADE_TEST}" != "false" && git checkout "${CI_COMMIT_SHA}" ${CI_TEST_SETTING}

if [ "${UPGRADE_TEST}" != "false" ]; then
git fetch --all && git checkout "$KUBESPRAY_VERSION"
# Checkout the CI vars file so it is available
git checkout "${CI_COMMIT_SHA}" tests/files/${CI_JOB_NAME}.yml
git checkout "${CI_COMMIT_SHA}" ${CI_TEST_REGISTRY_MIRROR}
git checkout "${CI_COMMIT_SHA}" ${CI_TEST_SETTING}
fi

run_playbook () {
playbook=$1
Expand All @@ -67,8 +68,10 @@ ansible-playbook --limit "all:!fake_hosts" \
run_playbook cluster.yml

# Repeat deployment if testing upgrade
case "${UPGRADE_TEST}" in
if [ "${UPGRADE_TEST}" != "false" ]; then
git checkout "${CI_COMMIT_SHA}"

case "${UPGRADE_TEST}" in
"basic")
run_playbook cluster.yml
;;
Expand All @@ -77,7 +80,8 @@ case "${UPGRADE_TEST}" in
;;
*)
;;
esac
esac
fi

# Test control plane recovery
if [ "${RECOVER_CONTROL_PLANE_TEST}" != "false" ]; then
Expand Down

0 comments on commit 89db882

Please sign in to comment.