77 "fmt"
88 "strconv"
99
10+ "github.com/ava-labs/avalanche-cli/pkg/constants"
1011 "github.com/ava-labs/avalanche-cli/tests/e2e/commands"
1112 ginkgo "github.com/onsi/ginkgo/v2"
1213 "github.com/onsi/gomega"
@@ -18,30 +19,29 @@ var _ = ginkgo.Describe("[Local Network] Start", ginkgo.Ordered, func() {
1819 })
1920
2021 ginkgo .It ("can start network with default params" , func () {
21- out := commands .StartNetwork ()
22+ out , err := commands .StartNetwork ()
23+ gomega .Expect (err ).Should (gomega .BeNil ())
2224 gomega .Expect (out ).Should (gomega .ContainSubstring ("Network ready to use" ))
2325
24- // https://github.com/ava-labs/avalanchego/blob/master/tests/fixture/tmpnet/defaults.go#L27
25- defaultNodeCount := 2
26-
2726 // check network status
28- out , err : = commands .GetNetworkStatus ()
27+ out , err = commands .GetNetworkStatus ()
2928 gomega .Expect (err ).Should (gomega .BeNil ())
3029 gomega .Expect (out ).Should (gomega .ContainSubstring ("Network is Up" ))
31- gomega .Expect (out ).Should (gomega .ContainSubstring (fmt .Sprintf ("Number of Nodes: %d" , defaultNodeCount )))
30+ gomega .Expect (out ).Should (gomega .ContainSubstring (fmt .Sprintf ("Number of Nodes: %d" , constants . LocalNetworkNumNodes )))
3231 gomega .Expect (out ).Should (gomega .ContainSubstring ("Network Healthy: true" ))
3332 gomega .Expect (out ).Should (gomega .ContainSubstring ("Blockchains Healthy: true" ))
3433 })
3534
3635 ginkgo .It ("can start network with given number of nodes" , func () {
3736 numOfNodes := uint (3 )
38- out := commands .StartNetworkWithParams (map [string ]string {
37+ out , err := commands .StartNetworkWithParams (map [string ]string {
3938 "number-of-nodes" : strconv .FormatUint (uint64 (numOfNodes ), 10 ),
4039 })
40+ gomega .Expect (err ).Should (gomega .BeNil ())
4141 gomega .Expect (out ).Should (gomega .ContainSubstring ("Network ready to use" ))
4242
4343 // check network status
44- out , err : = commands .GetNetworkStatus ()
44+ out , err = commands .GetNetworkStatus ()
4545 gomega .Expect (err ).Should (gomega .BeNil ())
4646 gomega .Expect (out ).Should (gomega .ContainSubstring ("Network is Up" ))
4747 gomega .Expect (out ).Should (gomega .ContainSubstring (fmt .Sprintf ("Number of Nodes: %d" , numOfNodes )))
@@ -50,13 +50,15 @@ var _ = ginkgo.Describe("[Local Network] Start", ginkgo.Ordered, func() {
5050 })
5151
5252 ginkgo .It ("should not start network with already started network" , func () {
53- out := commands .StartNetwork ()
53+ out , err := commands .StartNetwork ()
54+ gomega .Expect (err ).Should (gomega .BeNil ())
5455 gomega .Expect (out ).Should (gomega .ContainSubstring ("Network ready to use" ))
5556
56- out = commands .StartNetwork ()
57+ out , err = commands .StartNetwork ()
58+ gomega .Expect (err ).Should (gomega .BeNil ())
5759 gomega .Expect (out ).Should (gomega .ContainSubstring ("Network has already been booted" ))
5860
59- out , err : = commands .GetNetworkStatus ()
61+ out , err = commands .GetNetworkStatus ()
6062 gomega .Expect (err ).Should (gomega .BeNil ())
6163 gomega .Expect (out ).Should (gomega .ContainSubstring ("Network is Up" ))
6264 })
0 commit comments