diff --git a/Makefile b/Makefile index fc460454ce..dfa42b3e82 100644 --- a/Makefile +++ b/Makefile @@ -70,10 +70,6 @@ test-e2e-multi-consumer: test-e2e-parallel: go run ./tests/e2e/... --include-multi-consumer --parallel -# run E2E compatibility tests for v3.x -test-e2e-compatibility-v3: - go run ./tests/e2e/... -parallel -tc compatibility -pv v3.2.0-rc1 -pv v3.1.0 -pv v3.0.0 -cv v3.2.0-rc1 -cv v3.1.0 -cv v3.0.0 - # run full E2E tests in sequence (including multiconsumer) using latest tagged gaia test-gaia-e2e: go run ./tests/e2e/... --include-multi-consumer --use-gaia diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index d69ff87457..048b603979 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -484,6 +484,53 @@ type StartConsumerChainAction struct { GenesisChanges string } +func (tr *TestConfig) startConsumerChain( + action StartConsumerChainAction, + target ExecutionTarget, + verbose bool, +) { + fmt.Println("Starting consumer chain ", action.ConsumerChain) + consumerGenesis := ".app_state.ccvconsumer = " + tr.getConsumerGenesis(action.ProviderChain, action.ConsumerChain, target) + consumerGenesisChanges := tr.chainConfigs[action.ConsumerChain].GenesisChanges + if consumerGenesisChanges != "" { + consumerGenesis = consumerGenesis + " | " + consumerGenesisChanges + " | " + action.GenesisChanges + } + + tr.startChain(StartChainAction{ + Chain: action.ConsumerChain, + Validators: action.Validators, + GenesisChanges: consumerGenesis, + IsConsumer: true, + }, target, verbose) +} + +// Get consumer genesis from provider +func (tr *TestConfig) getConsumerGenesis(providerChain, consumerChain ChainID, target ExecutionTarget) string { + fmt.Println("Exporting consumer genesis from provider") + providerBinaryName := tr.chainConfigs[providerChain].BinaryName + + cmd := target.ExecCommand( + providerBinaryName, + + "query", "provider", "consumer-genesis", + string(tr.chainConfigs[consumerChain].ChainId), + + `--node`, tr.getQueryNode(providerChain), + `-o`, `json`, + ) + + bz, err := cmd.CombinedOutput() + if err != nil { + log.Fatal(err, "\n", string(bz)) + } + + // only needed when consumer is running v3.3.x and later + if tr.transformGenesis { + return string(tr.transformConsumerGenesis(consumerChain, bz, target)) + } + return string(bz) +} + // Transform consumer genesis content from older version func (tr *TestConfig) transformConsumerGenesis(consumerChain ChainID, genesis []byte, target ExecutionTarget) []byte { fmt.Println("Transforming consumer genesis") @@ -523,53 +570,6 @@ func (tr *TestConfig) transformConsumerGenesis(consumerChain ChainID, genesis [] return result } -// Get consumer genesis from provider -func (tr *TestConfig) getConsumerGenesis(providerChain, consumerChain ChainID, target ExecutionTarget) string { - fmt.Println("Exporting consumer genesis from provider") - providerBinaryName := tr.chainConfigs[providerChain].BinaryName - - cmd := target.ExecCommand( - providerBinaryName, - - "query", "provider", "consumer-genesis", - string(tr.chainConfigs[consumerChain].ChainId), - - `--node`, tr.getQueryNode(providerChain), - `-o`, `json`, - ) - - bz, err := cmd.CombinedOutput() - if err != nil { - log.Fatal(err, "\n", string(bz)) - } - - // only needed when consumer is running v3.3.x and later - if tr.transformGenesis { - return string(tr.transformConsumerGenesis(consumerChain, bz, target)) - } - return string(bz) -} - -func (tr *TestConfig) startConsumerChain( - action StartConsumerChainAction, - target ExecutionTarget, - verbose bool, -) { - fmt.Println("Starting consumer chain ", action.ConsumerChain) - consumerGenesis := ".app_state.ccvconsumer = " + tr.getConsumerGenesis(action.ProviderChain, action.ConsumerChain, target) - consumerGenesisChanges := tr.chainConfigs[action.ConsumerChain].GenesisChanges - if consumerGenesisChanges != "" { - consumerGenesis = consumerGenesis + " | " + consumerGenesisChanges + " | " + action.GenesisChanges - } - - tr.startChain(StartChainAction{ - Chain: action.ConsumerChain, - Validators: action.Validators, - GenesisChanges: consumerGenesis, - IsConsumer: true, - }, target, verbose) -} - type ChangeoverChainAction struct { SovereignChain ChainID ProviderChain ChainID diff --git a/tests/e2e/compatibility_tests.go b/tests/e2e/compatibility_tests.go deleted file mode 100644 index 14bd48d7c7..0000000000 --- a/tests/e2e/compatibility_tests.go +++ /dev/null @@ -1,20 +0,0 @@ -package main - -// Get compatible provider versions for this consumer -// -// Note: This is a hardcoded list of tags which has to be updated manually -// and serves as base information of different versions to be tested -// against this consumer implementation -func GetCompatibleProviderVersions() []string { - return []string{"v3.0.x"} -} - -// Get compatible consumer versions for this provider -// -// Note: This is a hardcoded list of tags which has to be updated manually -// and serves as base information of different versions to be tested -// against this provider implementation -func GetCompatibleConsumerVersions() []string { - // For now it's the same as for provider - return GetCompatibleProviderVersions() -} diff --git a/tests/e2e/main.go b/tests/e2e/main.go index e2afa5bee1..3c2c47b85a 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -60,8 +60,6 @@ var ( ) var ( - //useConsumerVersion = flag.String("consumer-version", "", "ICS tag to specify the consumer version to test the provider against") - //useProviderVersion = flag.String("provider-version", "", "ICS tag to specify the provider version to test the consumer against") consumerVersions VersionSet providerVersions VersionSet transformGenesis = flag.Bool("transform-genesis", false, "do consumer genesis transformation for newer clients. Needed when provider chain is on an older version")