Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

dolmen
Copy link
Contributor

@dolmen dolmen commented May 26, 2025

Run tests on CI with Go version stable (latest stable release) and oldstable (previous) which are currently 1.24.x and 1.23.x.
Previously the tests were only executed against the version declared in go.mod which is so far go 1.23.

Description

Change the CI workflow to run tests on rolling 'stable' and 'oldstable' releases of Go.

The LoadYAML test in pkg/apis/options/load_test.go had to be adapted because it doesn't pass on Go 1.24 because of a behaviour change in encoding/json (see CL 606956). So now the test pass on Go 1.24, but we disable that testsuite on Go 1.23 with a compile guard (I don't think it was worth the effort to develop a fix for those tests to work on both 1.23 and 1.24, as 1.23 will soon be out of the Go Team maintenance window).

Motivation and Context

So far tests only run against the Go version declared in go.mod which is 1.23.x. This means tests are not executed against the current stable release of Go (1.24.x). In fact running the tests on Go 1.24 has revealed a failing test that required adapting the testsuite.

How Has This Been Tested?

The push of this PR will trigger CI!

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.
  • I have written tests for my code changes.

dolmen added 2 commits June 19, 2025 10:21
Run tests on CI with Go version 'stable' (latest stable release) and 'oldstable'
(previous) which are currently 1.24.x and 1.23.x.
Previously the tests were only executed against the version declared in
go.mod which is so far go 1.23.
The LoadYAML test depends on error messages produced by
encoding/json that changed slightly (names of embedded structs are now
reported) so the test is adapted for Go 1.24.

Add a compile guard for Go < 1.24 to avoid failure.
@dolmen dolmen force-pushed the ci-run-tests-on-Go-stable-and-oldstable branch from 6aa53b3 to bef38d6 Compare June 19, 2025 08:21
@dolmen
Copy link
Contributor Author

dolmen commented Jun 23, 2025

@tuunit This is important: CI currently doesn't run with the lastest released Go version.

@dolmen
Copy link
Contributor Author

dolmen commented Aug 1, 2025

The go directive in go.mod has been upgraded to 1.24.5 in #3116, so now CI runs on an 1.24.5+ toolchain. So I'll close this issue.

I still have to check if the changes in bef38d6 have to be pushed separately or if the issue was fixed.

So I'm closing this.

@dolmen dolmen closed this Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant