Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
run: scripts/tests.integration.sh
- name: Run e2e tests
shell: bash
run: scripts/tests.e2e.sh 1.7.3
run: scripts/run.sh 1.7.3
env:
E2E: true
- name: Run GoReleaser for cross-platform builds
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ At its core, the Avalanche protocol still maintains the immutable ordered sequen

## Run `quarkvm` with local network

[`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.
[`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`

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

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

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

```bash
Expand Down
42 changes: 25 additions & 17 deletions scripts/tests.e2e.sh → scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
set -e

# e.g.,
# ./scripts/tests.e2e.sh 1.7.3
# ./scripts/run.sh 1.7.3
#
# to keep the cluster alive
# SHUTDOWN=false ./scripts/tests.e2e.sh 1.7.3
if ! [[ "$0" =~ scripts/tests.e2e.sh ]]; then
# to shut the cluster down
# SHUTDOWN=false ./scripts/run.sh 1.7.3

# to run E2E tests
# E2E=true ./scripts/run.sh 1.7.3
if ! [[ "$0" =~ scripts/run.sh ]]; then
echo "must be run from repository root"
exit 255
fi
Expand All @@ -18,8 +21,9 @@ if [[ -z "${VERSION}" ]]; then
exit 255
fi

SHUTDOWN=${SHUTDOWN:-true}
if [[ ${SHUTDOWN} == true ]]; then
SHUTDOWN=${SHUTDOWN:-false}
E2E=${E2E:-false}
if [[ ${SHUTDOWN} == true || ${E2E} == true ]]; then
_SHUTDOWN_FLAG="--shutdown"
else
_SHUTDOWN_FLAG=""
Expand Down Expand Up @@ -70,11 +74,13 @@ pushd ./tests/runner
go build -v -o /tmp/runner .
popd

echo "building e2e.test"
# to install the ginkgo binary (required for test build and run)
go install -v github.com/onsi/ginkgo/v2/[email protected]
ACK_GINKGO_RC=true ginkgo build ./tests/e2e
./tests/e2e/e2e.test --help
if [[ ${E2E} == true ]]; then
echo "building e2e.test"
# to install the ginkgo binary (required for test build and run)
go install -v github.com/onsi/ginkgo/v2/[email protected]
ACK_GINKGO_RC=true ginkgo build ./tests/e2e
./tests/e2e/e2e.test --help
fi

echo "launch local test cluster in the background"
/tmp/runner \
Expand Down Expand Up @@ -103,10 +109,12 @@ else
exit 255
fi

echo "running e2e tests against the local cluster with shutdown flag '${_SHUTDOWN_FLAG}'"
./tests/e2e/e2e.test \
--ginkgo.v \
--cluster-info-path /tmp/avalanchego-v${VERSION}/output.yaml \
${_SHUTDOWN_FLAG}
if [[ ${E2E} == true ]]; then
echo "running e2e tests against the local cluster with shutdown flag '${_SHUTDOWN_FLAG}'"
./tests/e2e/e2e.test \
--ginkgo.v \
--cluster-info-path /tmp/avalanchego-v${VERSION}/output.yaml \
${_SHUTDOWN_FLAG}

echo "ALL SUCCESS!"
echo "ALL SUCCESS!"
fi
1 change: 1 addition & 0 deletions tests/runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func newLocalNetwork(
"network-peer-list-gossip-frequency":"250ms",
"network-max-reconnect-delay":"1s",
"public-ip":"0.0.0.0",
"http-host":"",
"health-check-frequency":"2s",
"api-admin-enabled":true,
"api-ipcs-enabled":true,
Expand Down