From 75fae66dc6e4258fe8ac84a1e03117bdde7a3aff Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 4 Nov 2024 18:42:51 +0000 Subject: [PATCH] fix(ci): fail cache disk creation if no db version is found (#8987) In some cases Zebra logs might not output the database version, and thus we should avoid creating a disk without a version. Before this change, a disk was created without a db version number, just indicating a `-v-`, that caused other tests to fail as an actual version was not found in their regexes. --- .../workflows/sub-deploy-integration-tests-gcp.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sub-deploy-integration-tests-gcp.yml b/.github/workflows/sub-deploy-integration-tests-gcp.yml index 26c13e6044c..600153e6c32 100644 --- a/.github/workflows/sub-deploy-integration-tests-gcp.yml +++ b/.github/workflows/sub-deploy-integration-tests-gcp.yml @@ -503,18 +503,19 @@ jobs: ) if [[ -z "$INITIAL_DISK_DB_VERSION" ]]; then + # Check for new database creation + if echo "$DOCKER_LOGS" | grep -q "creating.new.database"; then + INITIAL_DISK_DB_VERSION="new" + else echo "Checked logs:" echo "" echo "$DOCKER_LOGS" echo "" - echo "Missing initial disk database version in logs: $INITIAL_DISK_DB_VERSION" + echo "Missing initial disk database version in logs" # Fail the tests, because Zebra didn't log the initial disk database version, # or the regex in this step is wrong. - false + exit 1 fi - - if [[ "$INITIAL_DISK_DB_VERSION" = "creating.new.database" ]]; then - INITIAL_DISK_DB_VERSION="new" else INITIAL_DISK_DB_VERSION="v${INITIAL_DISK_DB_VERSION//./-}" fi @@ -538,7 +539,7 @@ jobs: echo "Missing running database version in logs: $RUNNING_DB_VERSION" # Fail the tests, because Zebra didn't log the running database version, # or the regex in this step is wrong. - false + exit 1 fi RUNNING_DB_VERSION="v${RUNNING_DB_VERSION//./-}"