From 8262756a3a9723c9eccd6e1cedb9fde40a13aaf7 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 9 Feb 2023 13:11:44 +0000 Subject: [PATCH 1/5] Register required types for upgrade E2E tests --- e2e/testconfig/testconfig.go | 4 ++-- e2e/tests/upgrades/upgrade_test.go | 2 +- e2e/testsuite/codec.go | 5 ++++- e2e/testsuite/testsuite.go | 18 ++++++------------ 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/e2e/testconfig/testconfig.go b/e2e/testconfig/testconfig.go index 6c96c5942ba..5b3a3cad4f1 100644 --- a/e2e/testconfig/testconfig.go +++ b/e2e/testconfig/testconfig.go @@ -4,7 +4,6 @@ import ( "encoding/json" "fmt" "os" - "strings" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -139,7 +138,8 @@ func GetChainBTag() string { // if the tests are running locally. // Note: github actions passes a CI env value of true by default to all runners. func IsCI() bool { - return strings.ToLower(os.Getenv("CI")) == "true" + //return strings.ToLower(os.Getenv("CI")) == "true" + return false } // ChainOptions stores chain configurations for the chains that will be diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index 4a84e69a308..e9d912e6594 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -241,7 +241,7 @@ func (s *UpgradeTestSuite) TestV5ToV6ChainUpgrade() { t.Run("interchain account executes a bank transfer on behalf of the corresponding owner account", func(t *testing.T) { t.Run("fund interchain account wallet", func(t *testing.T) { - // fund the host account account so it has some $$ to send + // fund the host account, so it has some $$ to send err := chainB.SendFunds(ctx, interchaintest.FaucetAccountKeyName, ibc.WalletAmount{ Address: hostAccount, Amount: testvalues.StartingTokenAmount, diff --git a/e2e/testsuite/codec.go b/e2e/testsuite/codec.go index db0fa340b6c..93af7520e2c 100644 --- a/e2e/testsuite/codec.go +++ b/e2e/testsuite/codec.go @@ -10,6 +10,8 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" grouptypes "github.com/cosmos/cosmos-sdk/x/group" proposaltypes "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types" icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" feetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" @@ -42,7 +44,8 @@ func codecAndEncodingConfig() (*codec.ProtoCodec, simappparams.EncodingConfig) { authz.RegisterInterfaces(cfg.InterfaceRegistry) transfertypes.RegisterInterfaces(cfg.InterfaceRegistry) clienttypes.RegisterInterfaces(cfg.InterfaceRegistry) - + intertxtypes.RegisterInterfaces(cfg.InterfaceRegistry) + upgradetypes.RegisterInterfaces(cfg.InterfaceRegistry) cdc := codec.NewProtoCodec(cfg.InterfaceRegistry) return cdc, cfg } diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index 23558bae5e4..bc21442f2a6 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -49,10 +49,6 @@ const ( ChainBRelayerName = "rlyB" // DefaultGasValue is the default gas value used to configure tx.Factory DefaultGasValue = 500000 - // emptyLogs is the string value returned from `BroadcastMessages`. There are some situations in which - // the result is empty, when this happens we include the raw logs instead to get as much information - // amount the failure as possible. - emptyLogs = "[]" ) // E2ETestSuite has methods and functionality which can be shared among all test suites. @@ -403,14 +399,12 @@ func (s *E2ETestSuite) InitGRPCClients(chain *cosmos.CosmosChain) { // AssertValidTxResponse verifies that an sdk.TxResponse // has non-empty values. func (s *E2ETestSuite) AssertValidTxResponse(resp sdk.TxResponse) { - respLogsMsg := resp.Logs.String() - if respLogsMsg == emptyLogs { - respLogsMsg = resp.RawLog - } - s.Require().NotEqual(int64(0), resp.GasUsed, respLogsMsg) - s.Require().NotEqual(int64(0), resp.GasWanted, respLogsMsg) - s.Require().NotEmpty(resp.Events, respLogsMsg) - s.Require().NotEmpty(resp.Data, respLogsMsg) + errorMsg := fmt.Sprintf("%+v", resp) + s.Require().NotEmpty(resp.TxHash, errorMsg) + s.Require().NotEqual(int64(0), resp.GasUsed, errorMsg) + s.Require().NotEqual(int64(0), resp.GasWanted, errorMsg) + s.Require().NotEmpty(resp.Events, errorMsg) + s.Require().NotEmpty(resp.Data, errorMsg) } // AssertPacketRelayed asserts that the packet commitment does not exist on the sending chain. From 244271111af8e9788b2fca4521c5f7547ab0bd39 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 9 Feb 2023 13:12:24 +0000 Subject: [PATCH 2/5] removed temporary function update --- e2e/testconfig/testconfig.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/testconfig/testconfig.go b/e2e/testconfig/testconfig.go index 5b3a3cad4f1..6c96c5942ba 100644 --- a/e2e/testconfig/testconfig.go +++ b/e2e/testconfig/testconfig.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "os" + "strings" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -138,8 +139,7 @@ func GetChainBTag() string { // if the tests are running locally. // Note: github actions passes a CI env value of true by default to all runners. func IsCI() bool { - //return strings.ToLower(os.Getenv("CI")) == "true" - return false + return strings.ToLower(os.Getenv("CI")) == "true" } // ChainOptions stores chain configurations for the chains that will be From 47d6f74380b6e26e0dcf6e377877922e98906226 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 9 Feb 2023 13:40:15 +0000 Subject: [PATCH 3/5] registering additional types and specifying rc0 tag in upgrade test --- e2e/testsuite/codec.go | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/e2e/testsuite/codec.go b/e2e/testsuite/codec.go index 93af7520e2c..5ad4a78febe 100644 --- a/e2e/testsuite/codec.go +++ b/e2e/testsuite/codec.go @@ -16,7 +16,12 @@ import ( icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" feetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types" transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + v7migrations "github.com/cosmos/ibc-go/v7/modules/core/02-client/migrations/v7" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" + solomachine "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine" + ibctmtypes "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" simappparams "github.com/cosmos/ibc-go/v7/testing/simapp/params" ) @@ -32,20 +37,30 @@ func EncodingConfig() simappparams.EncodingConfig { func codecAndEncodingConfig() (*codec.ProtoCodec, simappparams.EncodingConfig) { cfg := simappparams.MakeTestEncodingConfig() + + // ibc types + icacontrollertypes.RegisterInterfaces(cfg.InterfaceRegistry) + feetypes.RegisterInterfaces(cfg.InterfaceRegistry) + intertxtypes.RegisterInterfaces(cfg.InterfaceRegistry) + solomachine.RegisterInterfaces(cfg.InterfaceRegistry) + v7migrations.RegisterInterfaces(cfg.InterfaceRegistry) + transfertypes.RegisterInterfaces(cfg.InterfaceRegistry) + clienttypes.RegisterInterfaces(cfg.InterfaceRegistry) + channeltypes.RegisterInterfaces(cfg.InterfaceRegistry) + connectiontypes.RegisterInterfaces(cfg.InterfaceRegistry) + ibctmtypes.RegisterInterfaces(cfg.InterfaceRegistry) + + // all other types + upgradetypes.RegisterInterfaces(cfg.InterfaceRegistry) banktypes.RegisterInterfaces(cfg.InterfaceRegistry) govv1beta1.RegisterInterfaces(cfg.InterfaceRegistry) govv1.RegisterInterfaces(cfg.InterfaceRegistry) authtypes.RegisterInterfaces(cfg.InterfaceRegistry) - feetypes.RegisterInterfaces(cfg.InterfaceRegistry) - icacontrollertypes.RegisterInterfaces(cfg.InterfaceRegistry) sdkcodec.RegisterInterfaces(cfg.InterfaceRegistry) grouptypes.RegisterInterfaces(cfg.InterfaceRegistry) proposaltypes.RegisterInterfaces(cfg.InterfaceRegistry) authz.RegisterInterfaces(cfg.InterfaceRegistry) - transfertypes.RegisterInterfaces(cfg.InterfaceRegistry) - clienttypes.RegisterInterfaces(cfg.InterfaceRegistry) - intertxtypes.RegisterInterfaces(cfg.InterfaceRegistry) - upgradetypes.RegisterInterfaces(cfg.InterfaceRegistry) + cdc := codec.NewProtoCodec(cfg.InterfaceRegistry) return cdc, cfg } From 6ed71d8c904b914e9122a1b176217fdc0437eed9 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 9 Feb 2023 13:55:29 +0000 Subject: [PATCH 4/5] updated workflow tag --- .github/workflows/e2e-upgrade.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index 89d27e50924..303d2ffeb3e 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -24,7 +24,7 @@ jobs: chain-binary: simd chain-a-tag: v6.0.0 chain-b-tag: v6.0.0 - chain-upgrade-tag: v7.0.0 + chain-upgrade-tag: v7.0.0-rc0 steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 From ae4ceb1a1d7c8b14ce6f6dd76dde1586956edca6 Mon Sep 17 00:00:00 2001 From: Cian Hatton Date: Thu, 9 Feb 2023 15:27:59 +0000 Subject: [PATCH 5/5] bump version to 6.1.0 --- .github/workflows/e2e-upgrade.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index 303d2ffeb3e..3f5ad92a957 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -22,8 +22,8 @@ jobs: - test: TestV6ToV7ChainUpgrade chain-image: ghcr.io/cosmos/ibc-go-simd chain-binary: simd - chain-a-tag: v6.0.0 - chain-b-tag: v6.0.0 + chain-a-tag: v6.1.0 + chain-b-tag: v6.1.0 chain-upgrade-tag: v7.0.0-rc0 steps: - uses: actions/checkout@v3