diff --git a/tests/utils/command.go b/tests/utils/command.go index 1522d97df5..30f04ab7b2 100644 --- a/tests/utils/command.go +++ b/tests/utils/command.go @@ -19,6 +19,22 @@ import ( "github.com/onsi/gomega" ) +const ( + // Timeout to boot the AvalancheGo node + bootAvalancheNodeTimeout = 5 * time.Minute + + // Timeout for the health API to check the AvalancheGo is ready + healthCheckTimeout = 5 * time.Second +) + +// At boot time subnets are created, one for each test suite. This global +// variable has all the subnets IDs that can be used. +// +// One process creates the AvalancheGo node and all the subnets, and these +// subnets IDs are passed to all other processes and stored in this global +// variable +var BlockchainIDs map[string]string + // RunCommand starts the command [bin] with the given [args] and returns the command to the caller // TODO cmd package mentions we can do this more efficiently with cmd.NewCmdOptions rather than looping // and calling Status(). @@ -60,32 +76,18 @@ func RegisterPingTest() { }) } -// At boot time subnets are created, one for each test suite. This global -// variable has all the subnets IDs that can be used. -// -// One process creates the AvalancheGo node and all the subnets, and these -// subnets IDs are passed to all other processes and stored in this global -// variable -var BlockchainIDs map[string]string - -// Timeout to boot the AvalancheGo node -var bootAvalancheNodeTimeout = 5 * time.Minute - -// Timeout for the health API to check the AvalancheGo is ready -var healthCheckTimeout = 5 * time.Second - func RegisterNodeRun() { // Keep track of the AvalancheGo external bash script, it is null for most // processes except the first process that starts AvalancheGo var startCmd *cmd.Cmd - // Our test suite runs in a separated processes, ginkgo hasI - // SynchronizedBeforeSuite() which is promised to run once, and its output is - // passed over to each worker. + // Our test suite runs in separate processes, ginkgo has + // SynchronizedBeforeSuite() which runs once, and its return value is passed + // over to each worker. // - // In here an AvalancheGo node instance is started, and subnets are created for - // each test case. Each test case has its own subnet, therefore all tests can - // run in parallel without any issue. + // Here an AvalancheGo node instance is started, and subnets are created for + // each test case. Each test case has its own subnet, therefore all tests + // can run in parallel without any issue. // // This function also compiles all the solidity contracts var _ = ginkgo.SynchronizedBeforeSuite(func() []byte { diff --git a/tests/utils/subnet.go b/tests/utils/subnet.go index e414bb8aaa..f1ef053707 100644 --- a/tests/utils/subnet.go +++ b/tests/utils/subnet.go @@ -111,8 +111,12 @@ func GetDefaultChainURI(blockchainID string) string { // 3. npx is available in the ./contracts directory func RunDefaultHardhatTests(ctx context.Context, blockchainID string, test string) { chainURI := GetDefaultChainURI(blockchainID) - log.Info("Executing HardHat tests on a new blockchain", "blockchainID", blockchainID, "test", test) - log.Info("Using subnet", "ChainURI", chainURI) + log.Info( + "Executing HardHat tests on a new blockchain", + "blockchainID", blockchainID, + "test", test, + "ChainURI", chainURI, + ) cmdPath := "./contracts" // test path is relative to the cmd path