Skip to content

Commit

Permalink
add e2e for status
Browse files Browse the repository at this point in the history
  • Loading branch information
arturrez committed Nov 22, 2024
1 parent 55131d7 commit e13d91c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
11 changes: 3 additions & 8 deletions tests/e2e/testcases/subnet/sov/addRemoveValidatorPoA/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package subnet
import (
"fmt"
"regexp"
"time"

"github.com/ava-labs/avalanche-cli/tests/e2e/commands"
"github.com/ava-labs/avalanche-cli/tests/e2e/utils"
Expand Down Expand Up @@ -111,18 +110,14 @@ var _ = ginkgo.Describe("[Etna AddRemove Validator SOV PoA]", func() {
fmt.Println(output)
})

ginkgo.It("Can wait for 10s", func() {
time.Sleep(10 * time.Second)
})

ginkgo.It("Can get status of cluster and check new validators", func() {
ginkgo.It("Can get status of the cluster", func() {
output, err := commands.GetLocalClusterStatus(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
fmt.Println(output)
// make sure we can find string with "http://127.0.0.1:9660" and "L1:Validating" string in the output
gomega.Expect(output).To(gomega.MatchRegexp(`http://127\.0\.0\.1:9660.*\[NodeID-[^\]]+\].*Validating\]`), "expect to have L1 validating")
gomega.Expect(output).To(gomega.MatchRegexp(`http://127\.0\.0\.1:9652.*\[NodeID-[^\]]+\].*Validating\]`), "expect to have L1 validating")
// make sure we can do the same for "http://127.0.0.1:9662"
gomega.Expect(output).To(gomega.MatchRegexp(`http://127\.0\.0\.1:9662.*\[NodeID-[^\]]+\].*Validating\]`), "expect to have L1 validating")
gomega.Expect(output).To(gomega.MatchRegexp(`http://127\.0\.0\.1:9654.*\[NodeID-[^\]]+\].*Validating\]`), "expect to have L1 validating")
})

ginkgo.It("Can remove bootstrap validator", func() {
Expand Down
10 changes: 3 additions & 7 deletions tests/e2e/testcases/subnet/sov/addRemoveValidatorPoS/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,14 @@ var _ = ginkgo.Describe("[Etna AddRemove Validator SOV PoS]", func() {
fmt.Println(output)
})

ginkgo.It("Can wait for 10s", func() {
time.Sleep(10 * time.Second)
})

ginkgo.It("Can get status of cluster and check new validators", func() {
ginkgo.It("Can get status of thecluster", func() {
output, err := commands.GetLocalClusterStatus(testLocalNodeName, subnetName)
gomega.Expect(err).Should(gomega.BeNil())
fmt.Println(output)
// make sure we can find string with "http://127.0.0.1:9660" and "L1:Validating" string in the output
gomega.Expect(output).To(gomega.MatchRegexp(`http://127\.0\.0\.1:9660.*\[NodeID-[^\]]+\].*Validating\]`), "expect to have L1 validating")
gomega.Expect(output).To(gomega.MatchRegexp(`http://127\.0\.0\.1:9652.*\[NodeID-[^\]]+\].*Validating\]`), "expect to have L1 validating")
// make sure we can do the same for "http://127.0.0.1:9662"
gomega.Expect(output).To(gomega.MatchRegexp(`http://127\.0\.0\.1:9662.*\[NodeID-[^\]]+\].*Validating\]`), "expect to have L1 validating")
gomega.Expect(output).To(gomega.MatchRegexp(`http://127\.0\.0\.1:9654.*\[NodeID-[^\]]+\].*Validating\]`), "expect to have L1 validating")
})

ginkgo.It("Can wait for min staking period to pass", func() {
Expand Down

0 comments on commit e13d91c

Please sign in to comment.