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

Fixing compatibility tests for v8 #4876

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion e2e/semverutil/semver.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ func (fr FeatureReleases) IsSupported(versionStr string) bool {
const releasePrefix = "release-"
if strings.HasPrefix(versionStr, releasePrefix) {
versionStr = versionStr[len(releasePrefix):]
versionStr = strings.ReplaceAll(versionStr, "x", "0")
// replace x with 999 so the release version is always larger than the others in the release line.
versionStr = strings.ReplaceAll(versionStr, "x", "999")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unrelated fix to ensure semver version comparisons are accurate

Copy link
Contributor

Choose a reason for hiding this comment

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

def sorter(key: str) -> str:
"""Since 'main' < 'vX.X.X' and we want to have 'main' as the first entry
in the list, we return a version that is considerably large. If ibc-go
reaches this version I'll wear my dunce hat and go sit in the corner.
"""
return "v99999.9.9" if key == "main" else key
prepare for the corner if wrong

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 think main > release-x.y.z > x.y.z

main already gets special treatment in this function

}

// assume any non-semantic version formatted version supports the feature
Expand Down
4 changes: 3 additions & 1 deletion e2e/testvalues/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,20 @@ var MemoFeatureReleases = semverutil.FeatureReleases{

// TotalEscrowFeatureReleases represents the releases the total escrow state entry was released in.
var TotalEscrowFeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8",
MinorVersions: []string{
"v7.1",
},
}

// IbcErrorsFeatureReleases represents the releases the IBC module level errors was released in.
var IbcErrorsFeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8.0",
MajorVersion: "v8",
}

// LocalhostClientFeatureReleases represents the releases the localhost client was released in.
var LocalhostClientFeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8",
MinorVersions: []string{
"v7.1",
},
Expand Down
Loading