github.com/MetalBlockchain/metalgo@v1.11.9/tests/e2e/e2e_test.go (about)

     1  // Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  package e2e_test
     5  
     6  import (
     7  	"testing"
     8  
     9  	// ensure test packages are scanned by ginkgo
    10  	_ "github.com/MetalBlockchain/metalgo/tests/e2e/banff"
    11  	_ "github.com/MetalBlockchain/metalgo/tests/e2e/c"
    12  	_ "github.com/MetalBlockchain/metalgo/tests/e2e/faultinjection"
    13  	_ "github.com/MetalBlockchain/metalgo/tests/e2e/p"
    14  	_ "github.com/MetalBlockchain/metalgo/tests/e2e/x"
    15  	_ "github.com/MetalBlockchain/metalgo/tests/e2e/x/transfer"
    16  
    17  	"github.com/MetalBlockchain/metalgo/tests/e2e/vms"
    18  	"github.com/MetalBlockchain/metalgo/tests/fixture/e2e"
    19  	"github.com/MetalBlockchain/metalgo/tests/fixture/tmpnet"
    20  
    21  	ginkgo "github.com/onsi/ginkgo/v2"
    22  )
    23  
    24  func TestE2E(t *testing.T) {
    25  	ginkgo.RunSpecs(t, "e2e test suites")
    26  }
    27  
    28  var flagVars *e2e.FlagVars
    29  
    30  func init() {
    31  	flagVars = e2e.RegisterFlags()
    32  }
    33  
    34  var _ = ginkgo.SynchronizedBeforeSuite(func() []byte {
    35  	// Run only once in the first ginkgo process
    36  
    37  	nodes := tmpnet.NewNodesOrPanic(flagVars.NodeCount())
    38  	subnets := vms.XSVMSubnetsOrPanic(nodes...)
    39  	return e2e.NewTestEnvironment(
    40  		flagVars,
    41  		&tmpnet.Network{
    42  			Owner:   "metalgo-e2e",
    43  			Nodes:   nodes,
    44  			Subnets: subnets,
    45  		},
    46  	).Marshal()
    47  }, func(envBytes []byte) {
    48  	// Run in every ginkgo process
    49  
    50  	// Initialize the local test environment from the global state
    51  	e2e.InitSharedTestEnvironment(envBytes)
    52  })