From 2dceb65612875384d7042c0d74ec8efe82dafe03 Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Tue, 12 Dec 2023 19:14:55 -0800 Subject: [PATCH] Ensure upgrade test uses the correct binary on restart Also: - Fix upgrade test workflow to target the correct path for artifact upload - Ensure all tmpnet artifact upload reports an error if files are missing --- .github/workflows/test.e2e.existing.yml | 1 + .github/workflows/test.e2e.yml | 1 + .github/workflows/test.upgrade.yml | 11 +++++------ scripts/tests.upgrade.sh | 13 ++++++++++--- tests/upgrade/upgrade_test.go | 4 +++- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.e2e.existing.yml b/.github/workflows/test.e2e.existing.yml index c00a328610d1..74ed60c897ec 100644 --- a/.github/workflows/test.e2e.existing.yml +++ b/.github/workflows/test.e2e.existing.yml @@ -37,3 +37,4 @@ jobs: with: name: tmpnet-data path: ~/.tmpnet/networks/1000 + if-no-files-found: error diff --git a/.github/workflows/test.e2e.yml b/.github/workflows/test.e2e.yml index 2f8e30156f72..4928734edcee 100644 --- a/.github/workflows/test.e2e.yml +++ b/.github/workflows/test.e2e.yml @@ -37,3 +37,4 @@ jobs: with: name: tmpnet-data path: ~/.tmpnet/networks/1000 + if-no-files-found: error diff --git a/.github/workflows/test.upgrade.yml b/.github/workflows/test.upgrade.yml index 8f8ec5fc35ed..5451425c49cc 100644 --- a/.github/workflows/test.upgrade.yml +++ b/.github/workflows/test.upgrade.yml @@ -30,12 +30,11 @@ jobs: run: ./scripts/build.sh - name: Run upgrade tests shell: bash - # 1.10.7 is the first version compatible with the ephnet fixture by - # virtue of writing a process context file on node start. - run: ./scripts/tests.upgrade.sh 1.10.7 - - name: Upload ephnet network dir + run: ./scripts/tests.upgrade.sh + - name: Upload tmpnet network dir uses: actions/upload-artifact@v3 if: always() with: - name: ephnet-data - path: ~/.ephnet/networks/1000 + name: tmpnet-data + path: ~/.tmpnet/networks/1000 + if-no-files-found: error diff --git a/scripts/tests.upgrade.sh b/scripts/tests.upgrade.sh index 34d5617bd128..8b274180cd12 100755 --- a/scripts/tests.upgrade.sh +++ b/scripts/tests.upgrade.sh @@ -3,14 +3,21 @@ set -euo pipefail # e.g., -# ./scripts/tests.upgrade.sh 1.7.16 -# AVALANCHEGO_PATH=./path/to/avalanchego ./scripts/tests.upgrade.sh 1.7.16 # Customization of avalanchego path +# ./scripts/tests.upgrade.sh # Use default version +# ./scripts/tests.upgrade.sh 1.10.18 # Specify a version +# AVALANCHEGO_PATH=./path/to/avalanchego ./scripts/tests.upgrade.sh 1.10.18 # Customization of avalanchego path if ! [[ "$0" =~ scripts/tests.upgrade.sh ]]; then echo "must be run from repository root" exit 255 fi -VERSION="${1:-}" +# 1.10.17 is the first version compatible with bls signing keys being +# included in the genesis. Attempting to upgrade from prior versions +# will result in nodes failing to boot due to the hash of the genesis +# not matching the hash of the committed genesis block. +DEFAULT_VERSION="1.10.17" + +VERSION="${1:-${DEFAULT_VERSION}}" if [[ -z "${VERSION}" ]]; then echo "Missing version argument!" echo "Usage: ${0} [VERSION]" >>/dev/stderr diff --git a/tests/upgrade/upgrade_test.go b/tests/upgrade/upgrade_test.go index b8f8147c831a..97a57a34b6a0 100644 --- a/tests/upgrade/upgrade_test.go +++ b/tests/upgrade/upgrade_test.go @@ -69,7 +69,9 @@ var _ = ginkgo.Describe("[Upgrade]", func() { node.Flags[config.BootstrapIPsKey] = strings.Join(bootstrapIPs, ",") require.NoError(node.WriteConfig()) - require.NoError(node.Start(ginkgo.GinkgoWriter, avalancheGoExecPath)) + // Ensure the new node starts with the upgrade binary + node.ExecPath = avalancheGoExecPathToUpgradeTo + require.NoError(node.Start(ginkgo.GinkgoWriter, "" /* defaultExecPath */)) ginkgo.By(fmt.Sprintf("waiting for node %q to report healthy after restart", node.GetID())) e2e.WaitForHealthy(node)