From 222dad2b514b41325cb685fc7691eb6ab2cd4bd0 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Wed, 17 Jan 2024 17:31:28 +0530 Subject: [PATCH] chore: add code coverage workflow --- .github/workflows/coverage.yaml | 27 + .gitignore | 2 + cli/go.mod | 17 +- go.work | 3 +- test/functional/{dive_test.go => dive.go} | 686 +++++++++++----------- test/functional/go.mod | 53 +- 6 files changed, 427 insertions(+), 361 deletions(-) create mode 100644 .github/workflows/coverage.yaml rename test/functional/{dive_test.go => dive.go} (66%) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 00000000..8d7ea813 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,27 @@ +name: Code Coverage with Codecov + +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + Coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: "1.21.4" + + - name: GO test + run: | + go list -f '{{.Dir}}/...' -m | xargs go test -short -timeout=3m -covermode=atomic -coverprofile=coverage.out + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/.gitignore b/.gitignore index 9d6c37a1..087c6f0a 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ logs/ output/ node_modules/ + +*.out diff --git a/cli/go.mod b/cli/go.mod index a10d7cc5..1c779f37 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,12 +1,12 @@ module github.com/hugobyte/dive-core/cli -go 1.21 +go 1.21.4 require ( github.com/briandowns/spinner v1.23.0 github.com/fatih/color v1.16.0 github.com/google/go-github v17.0.0+incompatible - github.com/kurtosis-tech/kurtosis/api/golang v0.86.4 + github.com/kurtosis-tech/kurtosis/api/golang v0.86.6 github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 github.com/natefinch/lumberjack v2.0.0+incompatible github.com/sirupsen/logrus v1.9.3 @@ -14,8 +14,9 @@ require ( ) require ( + github.com/google/go-cmp v0.6.0 // indirect github.com/kr/text v0.2.0 // indirect - github.com/kurtosis-tech/kurtosis/utils v0.0.0-20240110191550-e9142c271498 // indirect + github.com/kurtosis-tech/kurtosis/utils v0.0.0-20240116202251-69c57ec4384a // indirect github.com/mholt/archiver v3.1.1+incompatible // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect ) @@ -26,7 +27,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/google/uuid v1.5.0 // indirect - github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20240110191550-e9142c271498 // indirect + github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20240116202251-69c57ec4384a // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/objx v0.5.1 // indirect github.com/stretchr/testify v1.8.4 @@ -43,7 +44,7 @@ require ( github.com/google/go-querystring v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20231031173452-349f1ec9a443 // indirect - github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang v0.0.0-20240110191550-e9142c271498 // indirect + github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang v0.0.0-20240116202251-69c57ec4384a // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/nwaples/rardecode v1.1.3 // indirect @@ -56,9 +57,9 @@ require ( golang.org/x/sys v0.16.0 // indirect golang.org/x/term v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240108191215-35c7eff3a6b1 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect + google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect diff --git a/go.work b/go.work index ee624ffa..b5cc8027 100644 --- a/go.work +++ b/go.work @@ -1,7 +1,6 @@ -go 1.21.0 +go 1.21.4 use ( ./cli ./test/functional - ) diff --git a/test/functional/dive_test.go b/test/functional/dive.go similarity index 66% rename from test/functional/dive_test.go rename to test/functional/dive.go index 5e16f30b..b675cf08 100644 --- a/test/functional/dive_test.go +++ b/test/functional/dive.go @@ -1,4 +1,4 @@ -package dive_test +package dive import ( "bytes" @@ -8,7 +8,6 @@ import ( "os/exec" "testing" - dive "github.com/HugoByte/DIVE/test/functional" "github.com/hugobyte/dive-core/cli/cmd/utility" "github.com/hugobyte/dive-core/cli/common" "github.com/onsi/ginkgo/v2" @@ -36,12 +35,11 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { var stdout bytes.Buffer ginkgo.BeforeEach(func() { - cmd = dive.GetBinaryCommand() + cmd = GetBinaryCommand() cmd.Stdout = &testWriter{} cmd.Stderr = &testWriter{} }) - ginkgo.Describe("Smoke Tests", func() { ginkgo.It("should display the correct version", func() { cmd.Args = append(cmd.Args, "version") @@ -49,40 +47,40 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { err := cmd.Run() fmt.Println(stdout.String()) gomega.Expect(err).NotTo(gomega.HaveOccurred()) - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cli := common.GetCli(enclaveName) latestVersion := utility.GetLatestVersion(cli) gomega.Expect(stdout.String()).To(gomega.ContainSubstring(latestVersion)) }) ginkgo.It("should start bridge between icon and eth correctly", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and hardhat but with icon bridge set to true", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "hardhat", "--bmvbridge", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and icon", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between archway and archway using ibc", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "archway", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) @@ -91,416 +89,416 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { ginkgo.Describe("Bridge command Test", func() { ginkgo.It("should start bridge between icon and eth but with icon bridge set to true", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--bmvbridge", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and hardhat", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "hardhat", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and eth by running each chain individually", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedIconNode(enclaveName) - dive.RunEthNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ETH_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedIconNode(enclaveName) + RunEthNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ETH_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and hardhat by running each chain individually", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedIconNode(enclaveName) - dive.RunHardhatNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "hardhat", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.HARDHAT_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedIconNode(enclaveName) + RunHardhatNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "hardhat", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", HARDHAT_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and eth by running icon node first and then decentralising it", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) - serviceName0, endpoint0, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) - dive.DecentralizeCustomIconNode(nid0, endpoint0, serviceName0, enclaveName) + serviceName0, endpoint0, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) + DecentralizeCustomIconNode(nid0, endpoint0, serviceName0, enclaveName) - dive.RunEthNode(enclaveName) + RunEthNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ETH_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ETH_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between icon and hardhat by running icon node first and then decentralising it", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() - dive.RunIconNode(enclaveName) - serviceName0, endpoint0, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) - dive.DecentralizeCustomIconNode(nid0, endpoint0, serviceName0, enclaveName) + RunIconNode(enclaveName) + serviceName0, endpoint0, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) + DecentralizeCustomIconNode(nid0, endpoint0, serviceName0, enclaveName) - dive.RunHardhatNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "hardhat", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.HARDHAT_SERVICENAME, "--enclaveName", enclaveName) - dive.Clean(enclaveName) + RunHardhatNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "hardhat", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", HARDHAT_SERVICENAME, "--enclaveName", enclaveName) + Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between icon and icon by running one custom icon chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedIconNode(enclaveName) - dive.RunDecentralizedCustomIconNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedIconNode(enclaveName) + RunDecentralizedCustomIconNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and running custom icon later decentralising it", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedIconNode(enclaveName) - dive.RunCustomIconNode1(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedIconNode(enclaveName) + RunCustomIconNode1(enclaveName) - serviceName, endpoint, nid := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG1_SERVICENAME) - dive.DecentralizeCustomIconNode(nid, endpoint, serviceName, enclaveName) + serviceName, endpoint, nid := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG1_SERVICENAME) + DecentralizeCustomIconNode(nid, endpoint, serviceName, enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between icon and icon by running one icon chain and later decentralsing it. Running another custom icon chain and then decentralising it", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - dive.RunCustomIconNode1(enclaveName) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + RunCustomIconNode1(enclaveName) - serviceName0, endpoint0, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) - dive.DecentralizeCustomIconNode(nid0, endpoint0, serviceName0, enclaveName) + serviceName0, endpoint0, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) + DecentralizeCustomIconNode(nid0, endpoint0, serviceName0, enclaveName) - serviceName1, endpoint1, nid1 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG1_SERVICENAME) - dive.DecentralizeCustomIconNode(nid1, endpoint1, serviceName1, enclaveName) + serviceName1, endpoint1, nid1 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG1_SERVICENAME) + DecentralizeCustomIconNode(nid1, endpoint1, serviceName1, enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between 2 custom icon chains", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedCustomIconNode0(enclaveName) - dive.RunDecentralizedCustomIconNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedCustomIconNode0(enclaveName) + RunDecentralizedCustomIconNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between 2 custom icon chains by running them first and then decentralising it later", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomIconNode0(enclaveName) - dive.RunCustomIconNode1(enclaveName) + enclaveName := GenerateRandomName() + RunCustomIconNode0(enclaveName) + RunCustomIconNode1(enclaveName) - serviceName0, endpoint0, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) - dive.DecentralizeCustomIconNode(nid0, endpoint0, serviceName0, enclaveName) + serviceName0, endpoint0, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) + DecentralizeCustomIconNode(nid0, endpoint0, serviceName0, enclaveName) - serviceName1, endpoint1, nid1 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG1_SERVICENAME) - dive.DecentralizeCustomIconNode(nid1, endpoint1, serviceName1, enclaveName) + serviceName1, endpoint1, nid1 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG1_SERVICENAME) + DecentralizeCustomIconNode(nid1, endpoint1, serviceName1, enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between 2 chains when all nodes are running", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedIconNode(enclaveName) - dive.RunEthNode(enclaveName) - dive.RunHardhatNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ETH_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedIconNode(enclaveName) + RunEthNode(enclaveName) + RunHardhatNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ETH_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for bridge command", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "invalid_input", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for bridge command", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "invalid_input", "--chainB", "eth", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input ibc bridge command", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "invalid", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between archway and archway by running one custom archway chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunArchwayNode(enclaveName) - dive.RunCustomArchwayNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "archway", "--chainAServiceName", dive.DEFAULT_ARCHWAY_SERVICENAME, "--chainBServiceName", dive.ARCHWAY_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunArchwayNode(enclaveName) + RunCustomArchwayNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "archway", "--chainAServiceName", DEFAULT_ARCHWAY_SERVICENAME, "--chainBServiceName", ARCHWAY_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between 2 custom archway chains", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomArchwayNode0(enclaveName) - dive.RunCustomArchwayNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "archway", "--chainAServiceName", dive.ARCHWAY_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ARCHWAY_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomArchwayNode0(enclaveName) + RunCustomArchwayNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "archway", "--chainAServiceName", ARCHWAY_CONFIG0_SERVICENAME, "--chainBServiceName", ARCHWAY_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between archway to archway with 1 custom chain parameter", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomArchwayNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "archway", "--chainBServiceName", dive.ARCHWAY_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomArchwayNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "archway", "--chainBServiceName", ARCHWAY_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between neutron and neutron by running one custom neutron chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunNeutronNode(enclaveName) - dive.RunCustomNeutronNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "neutron", "--chainB", "neutron", "--chainAServiceName", dive.DEFAULT_NEUTRON_SERVICENAME, "--chainBServiceName", dive.NEUTRON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunNeutronNode(enclaveName) + RunCustomNeutronNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "neutron", "--chainB", "neutron", "--chainAServiceName", DEFAULT_NEUTRON_SERVICENAME, "--chainBServiceName", NEUTRON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between 2 custom neutron chains", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomNeutronNode0(enclaveName) - dive.RunCustomNeutronNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "neutron", "--chainB", "neutron", "--chainAServiceName", dive.NEUTRON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.NEUTRON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomNeutronNode0(enclaveName) + RunCustomNeutronNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "neutron", "--chainB", "neutron", "--chainAServiceName", NEUTRON_CONFIG0_SERVICENAME, "--chainBServiceName", NEUTRON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start IBC relay between nuetron to neutron with one 1 custom chain.", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomNeutronNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "neutron", "--chainB", "neutron", "--chainBServiceName", dive.NEUTRON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomNeutronNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "neutron", "--chainB", "neutron", "--chainBServiceName", NEUTRON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between archway and neutron chains", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "neutron", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between already running archway and neutron chains", func() { - enclaveName := dive.GenerateRandomName() - dive.RunArchwayNode(enclaveName) - dive.RunNeutronNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "neutron", "--chainAServiceName", dive.DEFAULT_ARCHWAY_SERVICENAME, "--chainBServiceName", dive.DEFAULT_NEUTRON_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunArchwayNode(enclaveName) + RunNeutronNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "neutron", "--chainAServiceName", DEFAULT_ARCHWAY_SERVICENAME, "--chainBServiceName", DEFAULT_NEUTRON_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between already running archway and neutron chains with custom configuration", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomNeutronNode0(enclaveName) - dive.RunCustomArchwayNode0(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "neutron", "--chainAServiceName", dive.ARCHWAY_CONFIG0_SERVICENAME, "--chainBServiceName", dive.NEUTRON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomNeutronNode0(enclaveName) + RunCustomArchwayNode0(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "archway", "--chainB", "neutron", "--chainAServiceName", ARCHWAY_CONFIG0_SERVICENAME, "--chainBServiceName", NEUTRON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start IBC relay between icon and archway", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start IBC relay between icon and neutron", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start IBC relay between already running icon and archway chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - dive.RunArchwayNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.DEFAULT_ARCHWAY_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + RunArchwayNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", DEFAULT_ARCHWAY_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start IBC relay between already running icon and neutron chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - dive.RunNeutronNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.DEFAULT_NEUTRON_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + RunNeutronNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", DEFAULT_NEUTRON_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start IBC relay between already running icon and custom archway chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - dive.RunCustomArchwayNode0(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.ARCHWAY_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + RunCustomArchwayNode0(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", ARCHWAY_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start IBC relay between already running icon and custom neutron chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - dive.RunCustomNeutronNode0(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.NEUTRON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + RunCustomNeutronNode0(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", NEUTRON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start IBC relay between already running custom icon and archway chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomIconNode0(enclaveName) - dive.RunArchwayNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--chainBServiceName", dive.DEFAULT_ARCHWAY_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomIconNode0(enclaveName) + RunArchwayNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--chainBServiceName", DEFAULT_ARCHWAY_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start IBC relay between already running custom icon and neutron chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomIconNode1(enclaveName) - dive.RunNeutronNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--chainAServiceName", dive.ICON_CONFIG1_SERVICENAME, "--chainBServiceName", dive.DEFAULT_NEUTRON_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomIconNode1(enclaveName) + RunNeutronNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--chainAServiceName", ICON_CONFIG1_SERVICENAME, "--chainBServiceName", DEFAULT_NEUTRON_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start IBC relay between already running custom icon and custom archway chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomIconNode1(enclaveName) - dive.RunCustomArchwayNode0(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--chainAServiceName", dive.ICON_CONFIG1_SERVICENAME, "--chainBServiceName", dive.ARCHWAY_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomIconNode1(enclaveName) + RunCustomArchwayNode0(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "archway", "--chainAServiceName", ICON_CONFIG1_SERVICENAME, "--chainBServiceName", ARCHWAY_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start IBC relay between already running custom icon and custom neutron chain", func() { - enclaveName := dive.GenerateRandomName() - dive.RunCustomIconNode1(enclaveName) - dive.RunCustomNeutronNode0(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--chainAServiceName", dive.ICON_CONFIG1_SERVICENAME, "--chainBServiceName", dive.NEUTRON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunCustomIconNode1(enclaveName) + RunCustomNeutronNode0(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "ibc", "--chainA", "icon", "--chainB", "neutron", "--chainAServiceName", ICON_CONFIG1_SERVICENAME, "--chainBServiceName", NEUTRON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between icon and hardhat by running icon node first and running bridge command directly", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedCustomIconNode0(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "hardhat", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedCustomIconNode0(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "hardhat", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between icon and hardhat by running hardhat node first and running bridge command directly", func() { - enclaveName := dive.GenerateRandomName() - dive.RunHardhatNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "hardhat", "--chainB", "icon", "--chainAServiceName", dive.HARDHAT_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunHardhatNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "hardhat", "--chainB", "icon", "--chainAServiceName", HARDHAT_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and eth by running icon node first and running bridge command directly", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedCustomIconNode0(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--chainAServiceName", dive.ICON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedCustomIconNode0(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "eth", "--chainAServiceName", ICON_CONFIG0_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) }) ginkgo.It("should start bridge between icon and eth by running eth node first and running bridge command directly", func() { - enclaveName := dive.GenerateRandomName() - dive.RunEthNode(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "eth", "--chainB", "icon", "--chainAServiceName", dive.ETH_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunEthNode(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "eth", "--chainB", "icon", "--chainAServiceName", ETH_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should start bridge between icon and icon by running icon node first and running bridge command directly", func() { - enclaveName := dive.GenerateRandomName() - dive.RunDecentralizedCustomIconNode1(enclaveName) - cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", dive.ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + RunDecentralizedCustomIconNode1(enclaveName) + cmd.Args = append(cmd.Args, "bridge", "btp", "--chainA", "icon", "--chainB", "icon", "--chainAServiceName", ICON_CONFIG1_SERVICENAME, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) defer os.Remove(fmt.Sprintf("updated-config-%s.json", enclaveName)) @@ -512,7 +510,7 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { ginkgo.It("should handle error when trying to clean if kurtosis engine is not running", func() { cmd1 := exec.Command("kurtosis", "engine", "stop") cmd1.Run() - bin := dive.GetBinPath() + bin := GetBinPath() cmd2 := exec.Command(bin, "clean") err := cmd2.Run() gomega.Expect(err).To(gomega.HaveOccurred()) @@ -529,131 +527,131 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { ginkgo.Describe("Icon chain commands", func() { ginkgo.It("should run single icon node testing", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "icon", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single icon node along with decentralisation", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "icon", "-d", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom Icon node-0", func() { - enclaveName := dive.GenerateRandomName() - updated_path := dive.UpdatePublicPort(enclaveName, dive.ICON_CONFIG0) - cmd.Args = append(cmd.Args, "chain", "icon", "-c", updated_path, "-g", dive.ICON_GENESIS0, "--enclaveName", enclaveName) + enclaveName := GenerateRandomName() + updated_path := UpdatePublicPort(enclaveName, ICON_CONFIG0) + cmd.Args = append(cmd.Args, "chain", "icon", "-c", updated_path, "-g", ICON_GENESIS0, "--enclaveName", enclaveName) defer os.Remove(updated_path) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom Icon node-1", func() { - enclaveName := dive.GenerateRandomName() - filepath := dive.ICON_CONFIG1 - updated_path := dive.UpdatePublicPort(enclaveName, filepath) - cmd.Args = append(cmd.Args, "chain", "icon", "-c", updated_path, "-g", dive.ICON_GENESIS1, "--enclaveName", enclaveName) + enclaveName := GenerateRandomName() + filepath := ICON_CONFIG1 + updated_path := UpdatePublicPort(enclaveName, filepath) + cmd.Args = append(cmd.Args, "chain", "icon", "-c", updated_path, "-g", ICON_GENESIS1, "--enclaveName", enclaveName) defer os.Remove(updated_path) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run icon node first and then decentralise it", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - serviceName0, endpoint0, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + serviceName0, endpoint0, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) cmd.Args = append(cmd.Args, "chain", "icon", "decentralize", "-p", "gochain", "-k", "keystores/keystore.json", "-n", nid0, "-e", endpoint0, "-s", serviceName0, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for chain command", func() { - enclaveName := dive.GenerateRandomName() - cmd.Args = append(cmd.Args, "chain", "icon", "-c", "invalid.json", "-g", dive.ICON_GENESIS0, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + cmd.Args = append(cmd.Args, "chain", "icon", "-c", "invalid.json", "-g", ICON_GENESIS0, "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for chain command", func() { - enclaveName := dive.GenerateRandomName() - cmd.Args = append(cmd.Args, "chain", "icon", "-c", dive.ICON_CONFIG0, "-g", "./config/invalid-icon-3.zip", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + enclaveName := GenerateRandomName() + cmd.Args = append(cmd.Args, "chain", "icon", "-c", ICON_CONFIG0, "-g", "./config/invalid-icon-3.zip", "--enclaveName", enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for chain command", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "icon", "-c", "../../cli/sample-jsons/invalid_config.json", "-g", "./config/invalid-icon-3.zip", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for chain command", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - serviceName0, endpoint0, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + serviceName0, endpoint0, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) cmd.Args = append(cmd.Args, "chain", "icon", "decentralize", "-p", "invalidPassword", "-k", "keystores/keystore.json", "-n", nid0, "-e", endpoint0, "-s", serviceName0, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for chain command", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - serviceName0, endpoint0, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + serviceName0, endpoint0, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) cmd.Args = append(cmd.Args, "chain", "icon", "decentralize", "-p", "gochain", "-k", "keystores/invalid.json", "-n", nid0, "-e", endpoint0, "-s", serviceName0, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for chain command", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - serviceName0, endpoint0, _ := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + serviceName0, endpoint0, _ := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) cmd.Args = append(cmd.Args, "chain", "icon", "decentralize", "-p", "gochain", "-k", "keystores/keystore.json", "-n", "0x9", "-e", endpoint0, "-s", serviceName0, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for chain command", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - serviceName0, _, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + serviceName0, _, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) cmd.Args = append(cmd.Args, "chain", "icon", "decentralize", "-p", "gochain", "-k", "keystores/keystore.json", "-n", nid0, "-e", "http://172.16.0.3:9081/api/v3/icon_dex", "-s", serviceName0, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should handle invalid input for chain command", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) - _, endpoint0, nid0 := dive.GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), dive.ICON_CONFIG0_SERVICENAME) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) + _, endpoint0, nid0 := GetServiceDetails(fmt.Sprintf("services_%s.json", enclaveName), ICON_CONFIG0_SERVICENAME) cmd.Args = append(cmd.Args, "chain", "icon", "decentralize", "-p", "gochain", "-k", "keystores/keystore.json", "-n", nid0, "-e", endpoint0, "-s", "icon-node", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should output user that chain is already running when trying to run icon chain that is already running", func() { - enclaveName := dive.GenerateRandomName() - dive.RunIconNode(enclaveName) + enclaveName := GenerateRandomName() + RunIconNode(enclaveName) cmd.Args = append(cmd.Args, "chain", "icon", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) @@ -662,18 +660,18 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { ginkgo.Describe("Eth chain commands", func() { ginkgo.It("should run single eth node", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "eth", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should output user that chain is already running when trying to run eth chain that is already running", func() { - enclaveName := dive.GenerateRandomName() - dive.RunEthNode(enclaveName) + enclaveName := GenerateRandomName() + RunEthNode(enclaveName) cmd.Args = append(cmd.Args, "chain", "eth", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) @@ -682,18 +680,18 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { ginkgo.Describe("Hardhat chain commands", func() { ginkgo.It("should run single hardhat node-1", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "hardhat", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should output user that chain is already running when trying to run hardhat chain that is already running", func() { - enclaveName := dive.GenerateRandomName() - dive.RunHardhatNode(enclaveName) + enclaveName := GenerateRandomName() + RunHardhatNode(enclaveName) cmd.Args = append(cmd.Args, "chain", "hardhat", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) @@ -701,38 +699,38 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { ginkgo.Describe("Archway chain commands", func() { ginkgo.It("should run single archway node", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "archway", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single custom archway node-1", func() { filepath1 := "../../cli/sample-jsons/archway.json" - updated_path1 := dive.UpdatePublicPorts(filepath1) - enclaveName := dive.GenerateRandomName() + updated_path1 := UpdatePublicPorts(filepath1) + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "archway", "-c", updated_path1, "--enclaveName", enclaveName) defer os.Remove(updated_path1) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single custom archway node with invalid json path", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "archway", "-c", "../../cli/sample-jsons/invalid_archway.json", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should output user that chain is already running when trying to run archway chain that is already running", func() { - enclaveName := dive.GenerateRandomName() - dive.RunArchwayNode(enclaveName) + enclaveName := GenerateRandomName() + RunArchwayNode(enclaveName) cmd.Args = append(cmd.Args, "chain", "archway", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) @@ -740,36 +738,36 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { ginkgo.Describe("Neutron chain commands", func() { ginkgo.It("should run single neutron node", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "neutron", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - }) + }) ginkgo.It("should run single custom neutron node-1", func() { - updated_path2 := dive.UpdateNeutronPublicPorts(dive.NEUTRON_CONFIG0) - enclaveName := dive.GenerateRandomName() + updated_path2 := UpdateNeutronPublicPorts(NEUTRON_CONFIG0) + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "neutron", "-c", updated_path2, "--enclaveName", enclaveName) defer os.Remove(updated_path2) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single custom neutron node with invalid json path", func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", "neutron", "-c", "../../cli/sample-jsons/neutron5.json", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) ginkgo.It("should output user that chain is already running when trying to run neutron chain that is already running", func() { - enclaveName := dive.GenerateRandomName() - dive.RunNeutronNode(enclaveName) + enclaveName := GenerateRandomName() + RunNeutronNode(enclaveName) cmd.Args = append(cmd.Args, "chain", "neutron", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).To(gomega.HaveOccurred()) }) @@ -800,73 +798,73 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { validChainSelected = true ginkgo.It("should run single relaychain "+relayChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single relaychain in mainnet for "+relayChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-n", "mainnet", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single relaychain in testnet for "+relayChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-n", "testnet", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain in localnet for "+relayChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateRelayChain(dive.LOCAL_CONFIG0, "local", "rococo-local", enclaveName, false, false) + enclaveName := GenerateRandomName() + config := UpdateRelayChain(LOCAL_CONFIG0, "local", "rococo-local", enclaveName, false, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain in testnet "+relayChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateRelayChain(dive.LOCAL_CONFIG0, "testnet", "rococo", enclaveName, false, false) + enclaveName := GenerateRandomName() + config := UpdateRelayChain(LOCAL_CONFIG0, "testnet", "rococo", enclaveName, false, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain in mainnet"+relayChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateRelayChain(dive.LOCAL_CONFIG0, "mainnet", "kusama", enclaveName, false, false) + enclaveName := GenerateRandomName() + config := UpdateRelayChain(LOCAL_CONFIG0, "mainnet", "kusama", enclaveName, false, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single relaychain with explorer and metrix service for "+relayChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "--explorer", "--metrics", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain with explorer services and metrics service in testnet for "+relayChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateRelayChain(dive.LOCAL_CONFIG0, "testnet", "rococo", enclaveName, true, true) + enclaveName := GenerateRandomName() + config := UpdateRelayChain(LOCAL_CONFIG0, "testnet", "rococo", enclaveName, true, true) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) @@ -952,77 +950,77 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { paraChainName := paraChainName ginkgo.It("should run single parachain in testnet for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "--no-relay", "-n", "testnet", "--enclaveName", enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run single parachain in mainnet for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "--no-relay", "-n", "mainnet", "--enclaveName", enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run single parachain in mainnet with explorer services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "--no-relay", "-n", "mainnet", "--explorer", "--enclaveName", enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run single parachain in mainnet with metrics services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "--no-relay", "-n", "mainnet", "--metrics", "--enclaveName", enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run custom parachain in testnet with for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateParaChain(dive.LOCAL_CONFIG0, "karura", false, false) + enclaveName := GenerateRandomName() + config := UpdateParaChain(LOCAL_CONFIG0, "karura", false, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "--no-relay", "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run custom parachain in mainnet for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateParaChain(dive.LOCAL_CONFIG0, "karura", false, false) + enclaveName := GenerateRandomName() + config := UpdateParaChain(LOCAL_CONFIG0, "karura", false, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "--no-relay", "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run custom parachain in mainnet with explorer services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateParaChain(dive.LOCAL_CONFIG0, "karura", true, false) + enclaveName := GenerateRandomName() + config := UpdateParaChain(LOCAL_CONFIG0, "karura", true, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "--no-relay", "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run custom parachain in mainnet with metrics services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateParaChain(dive.LOCAL_CONFIG0, "karura", false, true) + enclaveName := GenerateRandomName() + config := UpdateParaChain(LOCAL_CONFIG0, "karura", false, true) cmd.Args = append(cmd.Args, "chain", relayChainName, "--no-relay", "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run custom parachain in mainnet with explorer and metrics services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateParaChain(dive.LOCAL_CONFIG0, "karura", true, true) + enclaveName := GenerateRandomName() + config := UpdateParaChain(LOCAL_CONFIG0, "karura", true, true) cmd.Args = append(cmd.Args, "chain", relayChainName, "--no-relay", "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) } } @@ -1109,91 +1107,91 @@ var _ = ginkgo.Describe("DIVE CLI App", func() { paraChainName := paraChainName ginkgo.It("should run single relaychain and parachain in testnet for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "-n", "testnet", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single relaychain and parachain in mainnet for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "-n", "mainnet", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single relaychain and parachain in local for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "-n", "local", "--enclaveName", enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) - dive.Clean(enclaveName) + Clean(enclaveName) }) ginkgo.It("should run single relaychain and parachain in mainnet with explorer services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "-n", "mainnet", "--explorer", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run single relaychain and parachain in mainnet with metrics services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() + enclaveName := GenerateRandomName() cmd.Args = append(cmd.Args, "chain", relayChainName, "-p", paraChainName, "-n", "mainnet", "--metrics", "--enclaveName", enclaveName) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain and parachain in testnet for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateChainInfo(dive.LOCAL_CONFIG0, "testnet", "rococo", "karura", false, false) + enclaveName := GenerateRandomName() + config := UpdateChainInfo(LOCAL_CONFIG0, "testnet", "rococo", "karura", false, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain and parachain in mainnet for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateChainInfo(dive.LOCAL_CONFIG0, "mainnet", "polkadot", "karura", false, false) + enclaveName := GenerateRandomName() + config := UpdateChainInfo(LOCAL_CONFIG0, "mainnet", "polkadot", "karura", false, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain and parachain in local for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateChainInfo(dive.LOCAL_CONFIG0, "local", "rococo-local", "karura", false, false) + enclaveName := GenerateRandomName() + config := UpdateChainInfo(LOCAL_CONFIG0, "local", "rococo-local", "karura", false, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain and parachain in mainnet with explorer services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateChainInfo(dive.LOCAL_CONFIG0, "mainnet", "polkadot", "frequency", true, false) + enclaveName := GenerateRandomName() + config := UpdateChainInfo(LOCAL_CONFIG0, "mainnet", "polkadot", "frequency", true, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain and parachain in mainnet with metrics services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateChainInfo(dive.LOCAL_CONFIG0, "mainnet", "polkadot", "frequency", true, false) + enclaveName := GenerateRandomName() + config := UpdateChainInfo(LOCAL_CONFIG0, "mainnet", "polkadot", "frequency", true, false) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) ginkgo.It("should run custom relaychain and parachain in mainnet with explorer and metrics services for "+relayChainName+" and "+paraChainName, func() { - enclaveName := dive.GenerateRandomName() - config := dive.UpdateChainInfo(dive.LOCAL_CONFIG0, "mainnet", "polkadot", "frequency", true, true) + enclaveName := GenerateRandomName() + config := UpdateChainInfo(LOCAL_CONFIG0, "mainnet", "polkadot", "frequency", true, true) cmd.Args = append(cmd.Args, "chain", relayChainName, "-c", config, "--enclaveName", enclaveName) defer os.Remove(config) - defer dive.Clean(enclaveName) + defer Clean(enclaveName) err := cmd.Run() gomega.Expect(err).NotTo(gomega.HaveOccurred()) }) diff --git a/test/functional/go.mod b/test/functional/go.mod index b0d93b91..11d9765f 100644 --- a/test/functional/go.mod +++ b/test/functional/go.mod @@ -1,25 +1,64 @@ module github.com/HugoByte/DIVE/test/functional -go 1.21.0 +go 1.21.4 require ( + github.com/google/uuid v1.5.0 + github.com/hugobyte/dive-core/cli v0.0.0-20240117101917-8ee8b4124677 github.com/onsi/ginkgo/v2 v2.13.0 github.com/onsi/gomega v1.30.0 ) require ( - github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect + github.com/adrg/xdg v0.4.0 // indirect + github.com/briandowns/spinner v1.23.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/ghodss/yaml v1.0.0 // indirect github.com/go-logr/logr v1.2.4 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-yaml/yaml v2.1.0+incompatible // indirect github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-github v17.0.0+incompatible // indirect + github.com/google/go-querystring v1.1.0 // indirect github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect - github.com/nxadm/tail v1.4.8 // indirect - golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.15.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/kurtosis-tech/kurtosis-portal/api/golang v0.0.0-20231031173452-349f1ec9a443 // indirect + github.com/kurtosis-tech/kurtosis/api/golang v0.86.6 // indirect + github.com/kurtosis-tech/kurtosis/contexts-config-store v0.0.0-20240116202251-69c57ec4384a // indirect + github.com/kurtosis-tech/kurtosis/grpc-file-transfer/golang v0.0.0-20240116202251-69c57ec4384a // indirect + github.com/kurtosis-tech/kurtosis/utils v0.0.0-20240116202251-69c57ec4384a // indirect + github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mholt/archiver v3.1.1+incompatible // indirect + github.com/natefinch/lumberjack v2.0.0+incompatible // indirect + github.com/nwaples/rardecode v1.1.3 // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect + github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.5.1 // indirect + github.com/stretchr/testify v1.8.4 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect + github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/term v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.12.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/grpc v1.60.1 // indirect + google.golang.org/protobuf v1.32.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect )