Skip to content

Commit

Permalink
Fixing semver version check in e2e (cosmos#2307)
Browse files Browse the repository at this point in the history
  • Loading branch information
chatton authored Sep 20, 2022
1 parent 036c09e commit b97729d
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 2 deletions.
58 changes: 58 additions & 0 deletions e2e/scripts/test-matricies/icad/test-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[
{
"test-entry-point": "TestInterchainAccountsTestSuite",
"chain-binary": "icad",
"tests": [
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.1.4"
},
{
"chain-a-tag": "v0.1.4",
"chain-b-tag": "v0.3.3"
},
{
"chain-a-tag": "v0.2.3",
"chain-b-tag": "v0.3.3"
},
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.2.3"
},
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.3.3"
},
{
"chain-a-tag": "v0.2.3",
"chain-b-tag": "v0.2.3"
},
{
"chain-a-tag": "v0.1.4",
"chain-b-tag": "v0.1.4"
}
]
},
{
"test-entry-point": "TestIncentivizedInterchainAccountsTestSuite",
"chain-binary": "icad",
"tests": [
{
"chain-a-tag": "v0.2.3",
"chain-b-tag": "v0.3.3"
},
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.2.3"
},
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.3.3"
},
{
"chain-a-tag": "v0.2.3",
"chain-b-tag": "v0.2.3"
}
]
}
]
20 changes: 20 additions & 0 deletions e2e/scripts/test-matricies/main/test-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.2.3"
},
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.3.3"
},
{
"chain-a-tag": "v0.2.3",
"chain-b-tag": "v0.2.3"
},
{
"chain-a-tag": "v0.1.4",
"chain-b-tag": "v0.1.4"
}
]
},
Expand All @@ -76,6 +88,14 @@
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.2.3"
},
{
"chain-a-tag": "v0.3.3",
"chain-b-tag": "v0.3.3"
},
{
"chain-a-tag": "v0.2.3",
"chain-b-tag": "v0.2.3"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/interchain_accounts/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func (s *InterchainAccountsTestSuite) RegisterCounterPartyPayee(ctx context.Cont
// getICAVersion returns the version which should be used in the MsgRegisterAccount broadcast from the
// controller chain.
func getICAVersion(chainAVersion, chainBVersion string) string {
chainBIsGreaterThanChainA := semver.Compare(chainAVersion, chainBVersion) == -1
if chainBIsGreaterThanChainA {
chainBIsGreaterThanOrEqualToChainA := semver.Compare(chainAVersion, chainBVersion) <= 0
if chainBIsGreaterThanOrEqualToChainA {
// allow version to be specified by the controller chain
return ""
}
Expand Down

0 comments on commit b97729d

Please sign in to comment.