From a100d04034847b90547984a001b5a8f669524a9f Mon Sep 17 00:00:00 2001 From: Maru Newby Date: Fri, 22 Dec 2023 17:12:48 -0800 Subject: [PATCH] Add readme describing use of existing network --- tests/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000000..43234ede56 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,28 @@ +# Developing with tmpnet + +The `load/` and `warp/` paths contain end-to-end (e2e) tests that use +the [tmpnet +fixture](https://github.com/ava-labs/avalanchego/blob/dev/tests/fixture/tmpnet/README.md). By +default both test suites use the tmpnet fixture to create a temporary +network that exists for only the duration of their execution. + +It is possible to create a temporary network that can be reused across +test runs to minimize the setup cost involved: + +```bash +# From the root of a clone of avalanchego, build the tmpnetctl cli +$ ./scripts/build_tmpnetctl.sh + +# Start a new temporary network configured with subnet-evm's default plugin path +$ ./build/tmpnetctl start-network \ + --avalanche-path=./build/avalanchego + --plugin-dir=$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins + +# From the root of a clone of subnet-evm, execute the warp test suite against the existing network +$ ginkgo -vv ./tests/warp -- --use-existing-network --network-dir=$HOME/.tmpnet/networks/latest +``` + +The network started by `tmpnetctl` won't come with subnets configured, +so the test suite will add them to the network the first time it +runs. Subsequent test runs will be able to reuse those subnets without +having to set them up.