From 2f65f5635160e449ffd9c4c16b2c6cd1e076fbbd Mon Sep 17 00:00:00 2001 From: James Blair Date: Tue, 18 Jul 2023 20:16:55 +1200 Subject: [PATCH 1/2] Ensure release is run for arm64 e2e nightly tests. Signed-off-by: James Blair --- .github/workflows/e2e-arm64-nightly.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-arm64-nightly.yaml b/.github/workflows/e2e-arm64-nightly.yaml index 06c6298c0dc..3a36e5850f1 100644 --- a/.github/workflows/e2e-arm64-nightly.yaml +++ b/.github/workflows/e2e-arm64-nightly.yaml @@ -16,4 +16,4 @@ jobs: uses: ./.github/workflows/e2e-arm64-template.yaml with: etcdBranch: release-3.5 - e2eTestCmd: PASSES='build e2e' COVER='false' ./test.sh + e2eTestCmd: PASSES='build release e2e' COVER='false' ./test.sh From 3ff0128842cadb3abe90a2dd96eac2ec0d289412 Mon Sep 17 00:00:00 2001 From: James Blair Date: Tue, 18 Jul 2023 21:57:51 +1200 Subject: [PATCH 2/2] Fix obtaining UPGRADE_VER in test.sh Obtain tags from git ls-remote to avoid reliance on local repository state. Signed-off-by: James Blair --- scripts/test.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index b8537e0a5f9..93770974aa6 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -559,8 +559,30 @@ function dep_pass { function release_pass { rm -f ./bin/etcd-last-release - # to grab latest patch release; bump this up for every minor release - UPGRADE_VER=$(git tag -l --sort=-version:refname "v3.5.*" | head -1 | cut -d- -f1) + + # Work out the previous release based on the version reported by etcd binary + binary_version=$(./bin/etcd --version | grep --only-matching --perl-regexp '(?<=etcd Version: )\d+\.\d+') + binary_major=$(echo "${binary_version}" | cut -d '.' -f 1) + binary_minor=$(echo "${binary_version}" | cut -d '.' -f 2) + previous_minor=$((binary_minor - 1)) + + # Handle the edge case where we go to a new major version + # When this happens we obtain latest minor release of previous major + if [ "${binary_minor}" -eq 0 ]; then + binary_major=$((binary_major - 1)) + previous_minor=$(git ls-remote --tags https://github.com/etcd-io/etcd.git \ + | grep --only-matching --perl-regexp "(?<=v)${binary_major}.\d.[\d]+?(?=[\^])" \ + | sort --numeric-sort --key 1.3 | tail -1 | cut -d '.' -f 2) + fi + + # This gets a list of all remote tags for the release branch in regex + # Sort key is used to sort numerically by patch version + # Latest version is then stored for use below + UPGRADE_VER=$(git ls-remote --tags https://github.com/etcd-io/etcd.git \ + | grep --only-matching --perl-regexp "(?<=v)${binary_major}.${previous_minor}.[\d]+?(?=[\^])" \ + | sort --numeric-sort --key 1.5 | tail -1 | sed 's/^/v/') + log_callout "Found latest release: ${UPGRADE_VER}." + if [ -n "${MANUAL_VER:-}" ]; then # in case, we need to test against different version UPGRADE_VER=$MANUAL_VER