Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ const (
ValidatorCmd CommandGroup = "validator"
ICMCmd CommandGroup = "icm"
InterchainCmd CommandGroup = "interchain"
NodeCmd CommandGroup = "node"
)
21 changes: 21 additions & 0 deletions tests/e2e/commands/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import (

"gopkg.in/yaml.v3"

"github.com/ava-labs/avalanche-cli/cmd"
"github.com/ava-labs/avalanche-cli/pkg/constants"
"github.com/ava-labs/avalanche-cli/tests/e2e/utils"
"github.com/onsi/gomega"
)

Expand Down Expand Up @@ -207,6 +209,25 @@ func NodeImport(filename string, clusterName string) string {
return runCmd(cmd, ExpectSuccess)
}

func NodeLocalStart(clusterName string) (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start has a good amount of flags that can be tested

return utils.TestCommand(
cmd.NodeCmd,
"local",
[]string{
"start",
clusterName,
"--local",
},
utils.GlobalFlags{},
utils.TestFlags{},
)
}

// TODO:
// func NodeLocalStop()
// func NodeLocalStatus()
// func NodeLocalDestroy(clusterName string)

type StaticConfig struct {
Targets []string `yaml:"targets"`
}
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
_ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/network/stop"
_ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/create"
_ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/devnet"
_ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/local/start"
_ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/node/monitoring"
_ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/packageman"
_ "github.com/ava-labs/avalanche-cli/tests/e2e/testcases/relayer/deploy"
Expand Down
32 changes: 32 additions & 0 deletions tests/e2e/testcases/node/local/start/suite.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (C) 2025, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package root

import (
"github.com/ava-labs/avalanche-cli/tests/e2e/commands"
"github.com/onsi/ginkgo/v2"
"github.com/onsi/gomega"
)

var _ = ginkgo.Describe("[Node local start]", func() {
testClusterName := "test-cluster"

ginkgo.AfterEach(func() {
commands.CleanNetwork()
})

ginkgo.It("can create a local node with a started network", func() {
output := commands.StartNetwork()
gomega.Expect(output).Should(gomega.ContainSubstring("Network ready to use"))

output, err := commands.NodeLocalStart(testClusterName)
gomega.Expect(err).Should(gomega.BeNil())
gomega.Expect(output).Should(gomega.ContainSubstring("NodeID: NodeID-"))
})

ginkgo.It("should not create local nodes without a started network", func() {
output, _ := commands.NodeLocalStart(testClusterName)
gomega.Expect(output).Should(gomega.ContainSubstring("network is not running"))
})
})
Loading