Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e): compatibility e2e test fixes #5761

Merged
merged 12 commits into from
Jan 29, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added new files for compatibility testing of unordered ICA channels.

"chain-a": [
"main"
],
"chain-b": [
"main",
"v8.1.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not work until the tag is created, but I added it already anyway, since I am not planning to run this workflow before the release.

],
"entrypoint": [
"TestInterchainAccountsTestSuite"
],
"test": [
"TestMsgSendTx_SuccessfulTransfer_UnorderedChannel"
],
"relayer-type": [
"hermes"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"chain-a": [
"main",
"v8.1.0"
],
"chain-b": [
"main"
],
"entrypoint": [
"TestInterchainAccountsTestSuite"
],
"test": [
"TestMsgSendTx_SuccessfulTransfer_UnorderedChannel"
],
"relayer-type": [
"hermes"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"chain-a": [
"release-v8.1.x"
],
"chain-b": [
"release-v8.1.x"
],
"entrypoint": [
"TestInterchainAccountsTestSuite"
],
"test": [
"TestMsgSendTx_SuccessfulTransfer_UnorderedChannel"
],
"relayer-type": [
"hermes"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"chain-a": [
"release-v8.1.x"
],
"chain-b": [
"release-v8.1.x"
],
"entrypoint": [
"TestInterchainAccountsTestSuite"
],
"test": [
"TestMsgSendTx_SuccessfulTransfer_UnorderedChannel"
],
"relayer-type": [
"hermes"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"chain-a": [
"release-v8.1.x"
],
"chain-b": [
"release-v8.1.x"
],
"entrypoint": [
"TestInterchainAccountsTestSuite"
],
"test": [
"TestMsgSendTx_SuccessfulTransfer_UnorderedChannel"
],
"relayer-type": [
"hermes"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: Build image
run: |
# remove any `/` characters from the docker tag and replace them with a -
docker_tag="$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9]/-/g')"
docker_tag="$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9\.]/-/g')"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the . as an allowed character in docker image tags.

docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f modules/apps/callbacks/Dockerfile
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}"
2 changes: 1 addition & 1 deletion .github/workflows/build-simd-image-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
- name: Build image
run: |
# remove any `/` characters from the docker tag and replace them with a -
docker_tag="$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9]/-/g')"
docker_tag="$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9\.]/-/g')"
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" --build-arg IBC_GO_VERSION=${{ inputs.ibc-go-version }}
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}"
2 changes: 1 addition & 1 deletion .github/workflows/build-wasm-simd-image-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:

# remove all `/` or `+` characters from the docker tag and replace them with a -.
# this ensures the docker tag is valid.
docker_tag="$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9]/-/g')"
docker_tag="$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9\.]/-/g')"
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}" -f modules/light-clients/08-wasm/Dockerfile --build-arg LIBWASM_VERSION=${version} --build-arg LIBWASM_CHECKSUM=${checksum}
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:${docker_tag}"
4 changes: 2 additions & 2 deletions .github/workflows/e2e-compatibility-unreleased.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: |
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/[^a-zA-Z0-9]/-/g')"
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/[^a-zA-Z0-9\.]/-/g')"
# TODO: IBC_GO_VERSION does not yet do anything in the tests but is required.
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag" --build-arg IBC_GO_VERSION=${{ matrix.release-branch }}
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag"
- name: Display image details
run: |
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/[^a-zA-Z0-9]/-/g')"
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/[^a-zA-Z0-9\.]/-/g')"
docker inspect "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag"

transfer-1:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ jobs:
- name: Build image
if: env.RELEASE_BRANCH == matrix.release-branch
run: |
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/[^a-zA-Z0-9]/-/g')"
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/[^a-zA-Z0-9\.]/-/g')"
docker build . -t "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag" --build-arg IBC_GO_VERSION=${{ inputs.ibc-go-version }}
docker push "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag"
- name: Display image details
if: env.RELEASE_BRANCH == matrix.release-branch
run: |
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/[^a-zA-Z0-9]/-/g')"
docker_tag="$(echo ${{ matrix.release-branch }} | sed 's/[^a-zA-Z0-9\.]/-/g')"
docker inspect "${REGISTRY}/${ORG}/${IMAGE_NAME}:$docker_tag"

transfer-chain-a:
Expand Down
28 changes: 25 additions & 3 deletions e2e/tests/interchain_accounts/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulTransfer(order chan
// channel-0 is a transfer channel but it will not be used in this test case
relayer, _ := s.SetupChainsRelayerAndChannel(ctx, nil)
chainA, chainB := s.GetChains()
chainAVersion := chainA.Config().Images[0].Version

// setup 2 accounts: controller account on chain A, a second chain B account.
// host account will be created when the ICA is registered
Expand All @@ -72,9 +73,16 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulTransfer(order chan
var hostAccount string

t.Run("broadcast MsgRegisterInterchainAccount", func(t *testing.T) {
// Must broadcast MsgRegisterInterchainAccount with default value for order field
// for those versions where MsgRegisterInterchainAccount does not have the order field
msgOrder := order
if !testvalues.UnorderedICAChannelFeatureReleases.IsSupported(chainAVersion) {
msgOrder = channeltypes.NONE
}

// explicitly set the version string because we don't want to use incentivized channels.
version := icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAddress, version, order)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAddress, version, msgOrder)

txResp := s.BroadcastMessages(ctx, chainA, controllerAccount, msgRegisterAccount)
s.AssertTxSuccess(txResp)
Expand All @@ -94,7 +102,13 @@ func (s *InterchainAccountsTestSuite) testMsgSendTxSuccessfulTransfer(order chan
s.Require().NoError(err)
s.Require().Equal(len(channels), 2)
icaChannel := channels[0]
s.Require().Contains(orderMapping[order], icaChannel.Ordering)

// for the versions that don't support unordered channels, the ordering will default to ordered
orderKey := order
if !testvalues.UnorderedICAChannelFeatureReleases.IsSupported(chainAVersion) {
orderKey = channeltypes.ORDERED
}
s.Require().Contains(orderMapping[orderKey], icaChannel.Ordering)
})

t.Run("interchain account executes a bank transfer on behalf of the corresponding owner account", func(t *testing.T) {
Expand Down Expand Up @@ -161,6 +175,7 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_FailedTransfer_InsufficientF
// channel-0 is a transfer channel but it will not be used in this test case
relayer, _ := s.SetupChainsRelayerAndChannel(ctx, nil)
chainA, chainB := s.GetChains()
chainAVersion := chainA.Config().Images[0].Version

// setup 2 accounts: controller account on chain A, a second chain B account.
// host account will be created when the ICA is registered
Expand All @@ -170,9 +185,16 @@ func (s *InterchainAccountsTestSuite) TestMsgSendTx_FailedTransfer_InsufficientF
var hostAccount string

t.Run("broadcast MsgRegisterInterchainAccount", func(t *testing.T) {
// Must broadcast MsgRegisterInterchainAccount with default value for order field
// for those versions where MsgRegisterInterchainAccount does not have the order field
msgOrder := channeltypes.ORDERED
if !testvalues.UnorderedICAChannelFeatureReleases.IsSupported(chainAVersion) {
msgOrder = channeltypes.NONE
}

// explicitly set the version string because we don't want to use incentivized channels.
version := icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAddress, version, channeltypes.ORDERED)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAddress, version, msgOrder)

txResp := s.BroadcastMessages(ctx, chainA, controllerAccount, msgRegisterAccount)
s.AssertTxSuccess(txResp)
Expand Down
10 changes: 9 additions & 1 deletion e2e/tests/interchain_accounts/gov_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (s *InterchainAccountsGovTestSuite) TestInterchainAccountsGovIntegration()
// channel-0 is a transfer channel but it will not be used in this test case
relayer, _ := s.SetupChainsRelayerAndChannel(ctx, nil)
chainA, chainB := s.GetChains()
chainAVersion := chainA.Config().Images[0].Version
controllerAccount := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)

chainBAccount := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount)
Expand All @@ -53,8 +54,15 @@ func (s *InterchainAccountsGovTestSuite) TestInterchainAccountsGovIntegration()
s.Require().NotNil(govModuleAddress)

t.Run("execute proposal for MsgRegisterInterchainAccount", func(t *testing.T) {
// Must broadcast MsgRegisterInterchainAccount with default value for order field
// for those versions where MsgRegisterInterchainAccount does not have the order field
msgOrder := channeltypes.ORDERED
if !testvalues.UnorderedICAChannelFeatureReleases.IsSupported(chainAVersion) {
msgOrder = channeltypes.NONE
}

version := icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, govModuleAddress.String(), version, channeltypes.ORDERED)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, govModuleAddress.String(), version, msgOrder)
s.ExecuteAndPassGovV1Proposal(ctx, msgRegisterAccount, chainA, controllerAccount)
})

Expand Down
10 changes: 9 additions & 1 deletion e2e/tests/interchain_accounts/groups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func (s *InterchainAccountsGroupsTestSuite) TestInterchainAccountsGroupsIntegrat
// channel-0 is a transfer channel but it will not be used in this test case
relayer, _ := s.SetupChainsRelayerAndChannel(ctx, nil)
chainA, chainB := s.GetChains()
chainAVersion := chainA.Config().Images[0].Version

chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)
chainAAddress := chainAWallet.FormattedAddress()
Expand All @@ -114,8 +115,15 @@ func (s *InterchainAccountsGroupsTestSuite) TestInterchainAccountsGroupsIntegrat
})

t.Run("submit proposal for MsgRegisterInterchainAccount", func(t *testing.T) {
// Must broadcast MsgRegisterInterchainAccount with default value for order field
// for those versions where MsgRegisterInterchainAccount does not have the order field
msgOrder := channeltypes.ORDERED
if !testvalues.UnorderedICAChannelFeatureReleases.IsSupported(chainAVersion) {
msgOrder = channeltypes.NONE
}

groupPolicyAddr = s.QueryGroupPolicyAddress(ctx, chainA)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, groupPolicyAddr, icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID), channeltypes.ORDERED)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, groupPolicyAddr, icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID), msgOrder)

msgSubmitProposal, err := grouptypes.NewMsgSubmitProposal(groupPolicyAddr, []string{chainAAddress}, []sdk.Msg{msgRegisterAccount}, DefaultMetadata, grouptypes.Exec_EXEC_UNSPECIFIED, "e2e groups proposal: for MsgRegisterInterchainAccount", "e2e groups proposal: for MsgRegisterInterchainAccount")
s.Require().NoError(err)
Expand Down
20 changes: 18 additions & 2 deletions e2e/tests/interchain_accounts/incentivized_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func (s *IncentivizedInterchainAccountsTestSuite) TestMsgSendTx_SuccessfulBankSe
// channel-0 is a transfer channel but it will not be used in this test case
relayer, _ := s.SetupChainsRelayerAndChannel(ctx, nil)
chainA, chainB := s.GetChains()
chainAVersion := chainA.Config().Images[0].Version

var (
chainADenom = chainA.Config().Denom
Expand Down Expand Up @@ -71,8 +72,15 @@ func (s *IncentivizedInterchainAccountsTestSuite) TestMsgSendTx_SuccessfulBankSe
chainBAccount := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount)

t.Run("broadcast MsgRegisterInterchainAccount", func(t *testing.T) {
// Must broadcast MsgRegisterInterchainAccount with default value for order field
// for those versions where MsgRegisterInterchainAccount does not have the order field
msgOrder := channeltypes.ORDERED
if !testvalues.UnorderedICAChannelFeatureReleases.IsSupported(chainAVersion) {
msgOrder = channeltypes.NONE
}

version := "" // allow version to be specified by the controller chain since both chains should support incentivized channels
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAccount.FormattedAddress(), version, channeltypes.ORDERED)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAccount.FormattedAddress(), version, msgOrder)

txResp := s.BroadcastMessages(ctx, chainA, controllerAccount, msgRegisterAccount)
s.AssertTxSuccess(txResp)
Expand Down Expand Up @@ -221,6 +229,7 @@ func (s *IncentivizedInterchainAccountsTestSuite) TestMsgSendTx_FailedBankSend_I
// channel-0 is a transfer channel but it will not be used in this test case
relayer, _ := s.SetupChainsRelayerAndChannel(ctx, nil)
chainA, chainB := s.GetChains()
chainAVersion := chainA.Config().Images[0].Version

var (
chainADenom = chainA.Config().Denom
Expand Down Expand Up @@ -249,8 +258,15 @@ func (s *IncentivizedInterchainAccountsTestSuite) TestMsgSendTx_FailedBankSend_I
chainBAccount := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount)

t.Run("broadcast MsgRegisterInterchainAccount", func(t *testing.T) {
// Must broadcast MsgRegisterInterchainAccount with default value for order field
// for those versions where MsgRegisterInterchainAccount does not have the order field
msgOrder := channeltypes.ORDERED
if !testvalues.UnorderedICAChannelFeatureReleases.IsSupported(chainAVersion) {
msgOrder = channeltypes.NONE
}

version := "" // allow version to be specified by the controller chain since both chains should support incentivized channels
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAccount.FormattedAddress(), version, channeltypes.ORDERED)
msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, controllerAccount.FormattedAddress(), version, msgOrder)

txResp := s.BroadcastMessages(ctx, chainA, controllerAccount, msgRegisterAccount)
s.AssertTxSuccess(txResp)
Expand Down
Loading
Loading