Skip to content

Commit

Permalink
Fix failing transfer e2es (#7187)
Browse files Browse the repository at this point in the history
* chore: fixing failing transfer e2es

* chore: fix sample and ensure we keep containers on test failure
  • Loading branch information
chatton authored Aug 19, 2024
1 parent f698099 commit b996035
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/e2e-test-workflow-call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ jobs:
CHAIN_BINARY: '${{ inputs.chain-binary }}'
CHAIN_UPGRADE_TAG: '${{ inputs.chain-upgrade-tag }}'
CHAIN_UPGRADE_PLAN: '${{ inputs.upgrade-plan-name }}'
# explicitly set to true so that if a test fails, it doesn't delete the chain and cause other tests to fail.
KEEP_CONTAINERS: "true"
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions e2e/sample.config.extended.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
---
chains:
# the entry at index 0 corresponds to CHAIN_A
- chainId: chain-1
- chainId: chainA-1
numValidators: 4
numFullNodes: 1
image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE
tag: main # override with CHAIN_A_TAG
binary: simd # override with CHAIN_BINARY

# the entry at index 1 corresponds to CHAIN_B
- chainId: chain-2
- chainId: chainB-1
numValidators: 4
numFullNodes: 1
image: ghcr.io/cosmos/ibc-go-simd # override with CHAIN_IMAGE
Expand Down
13 changes: 11 additions & 2 deletions e2e/testsuite/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ func (tc TestConfig) validateChains() error {
}
}
}

// clienttypes.ParseChainID is used to determine revision heights. If the chainIDs are not in the expected format,
// tests can fail with timeout errors.
if clienttypes.ParseChainID(tc.GetChainAID()) != clienttypes.ParseChainID(tc.GetChainBID()) {
return fmt.Errorf("ensure both chainIDs are in the format {chainID}-{revision} and have the same revision. Got: chainA: %s, chainB: %s", tc.GetChainAID(), tc.GetChainBID())
}

return nil
}

Expand Down Expand Up @@ -229,19 +236,21 @@ func (tc TestConfig) GetChainNumFullNodes(idx int) int {
}

// GetChainAID returns the chain-id for chain A.
// NOTE: the default return value will ensure that ParseChainID will return 1 as the revision number.
func (tc TestConfig) GetChainAID() string {
if tc.ChainConfigs[0].ChainID != "" {
return tc.ChainConfigs[0].ChainID
}
return "chain-1"
return "chainA-1"
}

// GetChainBID returns the chain-id for chain B.
// NOTE: the default return value will ensure that ParseChainID will return 1 as the revision number.
func (tc TestConfig) GetChainBID() string {
if tc.ChainConfigs[1].ChainID != "" {
return tc.ChainConfigs[1].ChainID
}
return "chain-2"
return "chainB-1"
}

// GetChainName returns the name of the chain given an index.
Expand Down

0 comments on commit b996035

Please sign in to comment.