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.
chore: update to go 1.21
Prior to this change, we using go 1.20.
This change updates to go 1.21 and introduces the toolchain directive. With this update the tools.go file is no longer required for the test cases and it also highlighted some missing go mod tidy commands in the test cases.
refactor: remove sed dependency
Prior to this change, sed was used to remove the coverage results and timing data from test output of the test cases (i.e. where a test invoked
go test
via rsc.io/script). This is important because the test not reproducible otherwise. However, complex regular expressions to do this is fragile and difficult to change.This change wraps the go test command in a custom rsc.io/script command; this allows us to filter the JSON formatted test output using a go function. Only the output relating to individual tests is outputed (i.e. summary information is excluded) and we generate our own result (i.e. pass/fail/skip) lines with the elapsed time removed. Also, we now automatically pass the correct -coverpkg and -test.gocoverdir arguments without the conditional bash variable expansion polluting every txt archive file.
chore: improve readability of test in GH actions
Prior to this change, the test results are long and hard to see when one test ends and another starts.
This change introduces gotestfmt tool which format go test output into coloured, collapsible sections. Also, the original JSON output is uploaded in case of any issues, along with the raw coverage data.