Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates the test runner to use Go 1.22.
Go 1.22 introduces some changes to the test output, and the changes in the code of this PR accommodate for that.
Details
The main difference in the test output is that previously when a test would fail due to an error in compilation of the test, the
go test
command would produce a textual output without any json lines, despite the tests being run with the--json
flag. Now thego test
command respects the--json
flag, even when the test doesn't compile, and some lines of the output are json lines.Go 1.22 vs Go 1.21
go test --json
output differencesPreviously, the test runner was ignoring any json lines in the test output when the tests failed to compile. Now it doesn't ignore them, and includes some information of them in the test report.
Complete list of changes
Updated the Go version of the test runner to
1.22.5
(latest Go 1.22 release at the time of this PR), along with the base alpine image.From running the tests in the repo and also running the images manually with some examples, no regressions were found. The test outputs are the expected ones, and no significant differences found in the time the tests took to run.
Updated the dependency
stretchr/testify
(v1.8.2
->v1.9.0
)There was no particular reason for this, other than just trying to keep the dependencies up-to-date and avoid big bumps in versions later.
Updated golangci-lint
CI was failing with some errors due to the version of golangci-lint not being up-to-date. The github action was updated as well as the version of golangci-lint the action uses.
Separation of the logic of parsing the test output and processing it into two separate functions:
parseTestOutput
andprocessTestResults
.Previously this logic was mixed together into a single function, and parsing the test output (including looking for json lines) would only apply if the tests compiled and ran to completion. Since we now need this logic even if the tests don't run, made sense to make these 2 be separate steps.
Changed the expectations for when the tests don't compile / run to completion, the package level messages now appear first.
Previously the package level messages were appearing somewhere in the middle of the output. To keep the expectation as is, we would have to implement logic to insert these package level messages in the middle of the failed messages, which seems messy. I think changing the expectation slightly is fine in the case - the message contains the same information as before, just ordered differently.