Skip to content

Commit ada9937

Browse files
committed
e2e: Add avalanchego e2e job
1 parent 8ea8b18 commit ada9937

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,26 @@ jobs:
147147
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
148148
KURTOSIS_CLIENT_ID: ${{ secrets.KURTOSIS_CLIENT_ID }}
149149
KURTOSIS_CLIENT_SECRET: ${{ secrets.KURTOSIS_CLIENT_SECRET }}
150+
avalanchego_e2e:
151+
name: AvalancheGo E2E Tests v${{ matrix.go }} (${{ matrix.os }})
152+
runs-on: ${{ matrix.os }}
153+
strategy:
154+
matrix:
155+
go: [ '1.19' ]
156+
os: [ ubuntu-20.04 ]
157+
steps:
158+
- uses: actions/checkout@v3
159+
- name: check out ${{ github.event.inputs.avalanchegoRepo }} ${{ github.event.inputs.avalanchegoBranch }}
160+
if: ${{ github.event_name == 'workflow_dispatch' }}
161+
uses: actions/checkout@v3
162+
with:
163+
repository: ${{ github.event.inputs.avalanchegoRepo }}
164+
ref: ${{ github.event.inputs.avalanchegoBranch }}
165+
path: avalanchego
166+
token: ${{ secrets.AVALANCHE_PAT }}
167+
- uses: actions/setup-go@v3
168+
with:
169+
go-version: ${{ matrix.go }}
170+
- name: Run e2e tests
171+
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh
172+
shell: bash

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ awscpu
4444

4545
bin/
4646
build/
47+
48+
# Used for e2e testing
49+
avalanchego

scripts/tests.e2e.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# Run AvalancheGo e2e tests from the target version against the current state of coreth.
6+
7+
# e.g.,
8+
# ./scripts/tests.e2e.sh
9+
# AVALANCHE_VERSION=v1.10.x ./scripts/tests.e2e.sh
10+
11+
# Coreth root directory
12+
CORETH_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
13+
14+
# Load the version
15+
source "$CORETH_PATH"/scripts/versions.sh
16+
17+
echo "checking out target AvalancheGo version ${avalanche_version}"
18+
if [[ -d avalanchego ]]; then
19+
echo "updating existing clone"
20+
cd avalanchego
21+
git pull
22+
git checkout -B "${avalanche_version}"
23+
else
24+
echo "creating new clone"
25+
git clone -b "${avalanche_version}" --single-branch https://github.com/ava-labs/avalanchego.git
26+
cd avalanchego
27+
fi
28+
29+
echo "updating coreth dependency to point to local path"
30+
go mod edit -replace github.com/ava-labs/coreth=../
31+
go mod tidy
32+
33+
echo "building with race detection"
34+
./scripts/build.sh -r
35+
36+
echo "running AvalancheGo e2e tests"
37+
./scripts/tests.e2e.sh ./build/avalanchego

0 commit comments

Comments
 (0)