-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* e2e: Add avalanchego e2e job * fixup: Use currently supported golang version * fixup: Enable configurable avalanchego clone path
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,6 @@ awscpu | |
|
||
bin/ | ||
build/ | ||
|
||
# Used for e2e testing | ||
avalanchego |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Run AvalancheGo e2e tests from the target version against the current state of coreth. | ||
|
||
# e.g., | ||
# ./scripts/tests.e2e.sh | ||
# AVALANCHE_VERSION=v1.10.x ./scripts/tests.e2e.sh | ||
if ! [[ "$0" =~ scripts/tests.e2e.sh ]]; then | ||
echo "must be run from repository root" | ||
exit 255 | ||
fi | ||
|
||
# Coreth root directory | ||
CORETH_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) | ||
|
||
# Allow configuring the clone path to point to an existing clone | ||
AVALANCHEGO_CLONE_PATH="${AVALANCHEGO_CLONE_PATH:-avalanchego}" | ||
|
||
# Load the version | ||
source "$CORETH_PATH"/scripts/versions.sh | ||
|
||
# Always return to the coreth path on exit | ||
function cleanup { | ||
cd "${CORETH_PATH}" | ||
} | ||
trap cleanup EXIT | ||
|
||
echo "checking out target AvalancheGo version ${avalanche_version}" | ||
if [[ -d "${AVALANCHEGO_CLONE_PATH}" ]]; then | ||
echo "updating existing clone" | ||
cd "${AVALANCHEGO_CLONE_PATH}" | ||
git fetch | ||
git checkout -B "${avalanche_version}" | ||
else | ||
echo "creating new clone" | ||
git clone -b "${avalanche_version}"\ | ||
--single-branch https://github.com/ava-labs/avalanchego.git\ | ||
"${AVALANCHEGO_CLONE_PATH}" | ||
cd "${AVALANCHEGO_CLONE_PATH}" | ||
fi | ||
|
||
echo "updating coreth dependency to point to ${CORETH_PATH}" | ||
go mod edit -replace "github.com/ava-labs/coreth=${CORETH_PATH}" | ||
go mod tidy | ||
|
||
echo "building avalanchego" | ||
./scripts/build.sh -r | ||
|
||
echo "running AvalancheGo e2e tests" | ||
./scripts/tests.e2e.sh ./build/avalanchego |