Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit d16d7f1

Browse files
Merge pull request #45 from ava-labs/fix-everywhere
Fix everywhere + easier start script
2 parents 3001c8c + 50d04aa commit d16d7f1

File tree

4 files changed

+34
-23
lines changed

4 files changed

+34
-23
lines changed

.github/workflows/build-test-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ jobs:
2929
run: scripts/tests.integration.sh
3030
- name: Run e2e tests
3131
shell: bash
32-
run: scripts/tests.e2e.sh 1.7.3
32+
run: scripts/run.sh 1.7.3
33+
env:
34+
E2E: true
3335
- name: Run GoReleaser for cross-platform builds
3436
uses: goreleaser/goreleaser-action@v2
3537
with:

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ At its core, the Avalanche protocol still maintains the immutable ordered sequen
3232

3333
## Run `quarkvm` with local network
3434

35-
[`scripts/tests.e2e.sh`](scripts/tests.e2e.sh) automatically installs [avalanchego](https://github.com/ava-labs/avalanchego) to set up a local network, creates `quarkvm` genesis file, and run e2e tests.
35+
[`scripts/run.sh`](scripts/run.sh) automatically installs [avalanchego](https://github.com/ava-labs/avalanchego) to set up a local networkand creates a `quarkvm` genesis file. To build and run E2E tests, you need to set the variable `E2E` before it: `E2E=true ./scripts/run.sh 1.7.3`
3636

3737
See [`tests/e2e`](tests/e2e) and [`tests/runner`](tests/runner) to see how it's set up and how its client requests are made:
3838

3939
```bash
40-
# to run full e2e tests and shut down cluster afterwards
40+
# to startup a cluster
4141
cd ${HOME}/go/src/github.com/ava-labs/quarkvm
42-
./scripts/tests.e2e.sh 1.7.3
42+
./scripts/run.sh 1.7.3
4343

44-
# to run full e2e tests and keep the cluster alive
44+
# to run full e2e tests and shut down cluster afterwards
4545
cd ${HOME}/go/src/github.com/ava-labs/quarkvm
46-
SHUTDOWN=false ./scripts/tests.e2e.sh 1.7.3
46+
E2E=true ./scripts/run.sh 1.7.3
4747
```
4848

4949
```bash

scripts/tests.e2e.sh renamed to scripts/run.sh

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
set -e
33

44
# e.g.,
5-
# ./scripts/tests.e2e.sh 1.7.3
5+
# ./scripts/run.sh 1.7.3
66
#
7-
# to keep the cluster alive
8-
# SHUTDOWN=false ./scripts/tests.e2e.sh 1.7.3
9-
if ! [[ "$0" =~ scripts/tests.e2e.sh ]]; then
7+
# to shut the cluster down
8+
# SHUTDOWN=false ./scripts/run.sh 1.7.3
9+
10+
# to run E2E tests
11+
# E2E=true ./scripts/run.sh 1.7.3
12+
if ! [[ "$0" =~ scripts/run.sh ]]; then
1013
echo "must be run from repository root"
1114
exit 255
1215
fi
@@ -18,8 +21,9 @@ if [[ -z "${VERSION}" ]]; then
1821
exit 255
1922
fi
2023

21-
SHUTDOWN=${SHUTDOWN:-true}
22-
if [[ ${SHUTDOWN} == true ]]; then
24+
SHUTDOWN=${SHUTDOWN:-false}
25+
E2E=${E2E:-false}
26+
if [[ ${SHUTDOWN} == true || ${E2E} == true ]]; then
2327
_SHUTDOWN_FLAG="--shutdown"
2428
else
2529
_SHUTDOWN_FLAG=""
@@ -70,11 +74,13 @@ pushd ./tests/runner
7074
go build -v -o /tmp/runner .
7175
popd
7276

73-
echo "building e2e.test"
74-
# to install the ginkgo binary (required for test build and run)
75-
go install -v github.com/onsi/ginkgo/v2/[email protected]
76-
ACK_GINKGO_RC=true ginkgo build ./tests/e2e
77-
./tests/e2e/e2e.test --help
77+
if [[ ${E2E} == true ]]; then
78+
echo "building e2e.test"
79+
# to install the ginkgo binary (required for test build and run)
80+
go install -v github.com/onsi/ginkgo/v2/[email protected]
81+
ACK_GINKGO_RC=true ginkgo build ./tests/e2e
82+
./tests/e2e/e2e.test --help
83+
fi
7884

7985
echo "launch local test cluster in the background"
8086
/tmp/runner \
@@ -103,10 +109,12 @@ else
103109
exit 255
104110
fi
105111

106-
echo "running e2e tests against the local cluster with shutdown flag '${_SHUTDOWN_FLAG}'"
107-
./tests/e2e/e2e.test \
108-
--ginkgo.v \
109-
--cluster-info-path /tmp/avalanchego-v${VERSION}/output.yaml \
110-
${_SHUTDOWN_FLAG}
112+
if [[ ${E2E} == true ]]; then
113+
echo "running e2e tests against the local cluster with shutdown flag '${_SHUTDOWN_FLAG}'"
114+
./tests/e2e/e2e.test \
115+
--ginkgo.v \
116+
--cluster-info-path /tmp/avalanchego-v${VERSION}/output.yaml \
117+
${_SHUTDOWN_FLAG}
111118

112-
echo "ALL SUCCESS!"
119+
echo "ALL SUCCESS!"
120+
fi

tests/runner/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ func newLocalNetwork(
195195
"network-peer-list-gossip-frequency":"250ms",
196196
"network-max-reconnect-delay":"1s",
197197
"public-ip":"0.0.0.0",
198+
"http-host":"",
198199
"health-check-frequency":"2s",
199200
"api-admin-enabled":true,
200201
"api-ipcs-enabled":true,

0 commit comments

Comments
 (0)