Skip to content

Commit 534a86e

Browse files
authored
e2e: Add bootstrap checks to migrated kurtosis tests (#1935)
1 parent d569635 commit 534a86e

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed

tests/e2e/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,15 @@ ginkgo -v ./tests/e2e -- \
7676
```
7777

7878
See the testnet fixture [README](../fixture/testnet/README.md) for more details.
79+
80+
## Skipping bootstrap checks
81+
82+
By default many tests will attempt to bootstrap a new node with the
83+
post-test network state. While this is a valuable activity to perform
84+
in CI, it can add considerable latency to test development. To disable
85+
these bootstrap checks during development, set the
86+
`E2E_SKIP_BOOTSTRAP_CHECKS` env var to a non-empty value:
87+
88+
```bash
89+
E2E_SKIP_BOOTSTRAP_CHECKS=1 ginkgo -v ./tests/e2e ...
90+
```

tests/e2e/c/interchain_workflow.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,7 @@ var _ = e2e.DescribeCChain("[Interchain Workflow]", func() {
163163
require.NoError(err)
164164
require.Greater(balances[avaxAssetID], uint64(0))
165165
})
166+
167+
e2e.CheckBootstrapIsPossible(e2e.Env.GetNetwork())
166168
})
167169
})

tests/e2e/e2e.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"fmt"
1212
"math/big"
1313
"math/rand"
14+
"os"
1415
"strings"
1516
"time"
1617

@@ -53,6 +54,11 @@ const (
5354
// Interval appropriate for network operations that should be
5455
// retried periodically but not too often.
5556
DefaultPollingInterval = 500 * time.Millisecond
57+
58+
// Setting this env will disable post-test bootstrap
59+
// checks. Useful for speeding up iteration during test
60+
// development.
61+
SkipBootstrapChecksEnvName = "E2E_SKIP_BOOTSTRAP_CHECKS"
5662
)
5763

5864
// Env is used to access shared test fixture. Intended to be
@@ -247,3 +253,14 @@ func WithSuggestedGasPrice(ethClient ethclient.Client) common.Option {
247253
baseFee := SuggestGasPrice(ethClient)
248254
return common.WithBaseFee(baseFee)
249255
}
256+
257+
// Verify that a new node can bootstrap into the network.
258+
func CheckBootstrapIsPossible(network testnet.Network) {
259+
if len(os.Getenv(SkipBootstrapChecksEnvName)) > 0 {
260+
tests.Outf("{{yellow}}Skipping bootstrap check due to the %s env var being set", SkipBootstrapChecksEnvName)
261+
return
262+
}
263+
ginkgo.By("checking if bootstrap is possible with the current network state")
264+
node := AddEphemeralNode(network, testnet.FlagsMap{})
265+
WaitForHealthy(node)
266+
}

tests/e2e/faultinjection/duplicate_node_id.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ var _ = ginkgo.Describe("Duplicate node handling", func() {
5757

5858
ginkgo.By("checking that the second new node is connected to its peers")
5959
checkConnectedPeers(nodes, node2)
60+
61+
// A bootstrap check was already performed by the second node.
6062
})
6163
})
6264

tests/e2e/x/interchain_workflow.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,7 @@ var _ = e2e.DescribeXChain("[Interchain Workflow]", func() {
148148
require.NoError(err)
149149
require.Greater(balances[avaxAssetID], uint64(0))
150150
})
151+
152+
e2e.CheckBootstrapIsPossible(e2e.Env.GetNetwork())
151153
})
152154
})

0 commit comments

Comments
 (0)