Run Go tests through gotestsum with dorny/test-reporter#280
Run Go tests through gotestsum with dorny/test-reporter#280mariusvniekerk merged 3 commits intomainfrom
Conversation
git's `--raw` output ignores `-w` because it compares blob SHAs, while `--numstat` honors it. The worktree diff helpers merged both feeds but only used numstat to populate addition/deletion counts, so a whitespace- only modification stayed in the file list with 0/0 counts even when hideWhitespace was true. The reproduction: $ git diff --raw -w HEAD → M f.txt $ git diff --numstat -w HEAD → (empty) Use the numstat map as ground truth for tracked content changes: when hideWhitespace is true, drop any "modified" entry whose path is absent from numstat. Renames, copies, additions, and deletions are kept since their presence in --raw still reflects a real history change even with 0/0 counts. Surfaced by TestWorktreeDiffFilesHidesWhitespaceOnlyChanges, which now passes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Wire `gotestsum --format pkgname-and-test-fails --jsonfile` into the Makefile (`test`, `test-short`, `test-integration`, `test-gitlab-container`) and CI so passing packages collapse to a single line and failures keep their full output. Each Go test step in CI now writes a JSON event log under `tmp/` that `dorny/test-reporter@v2.7.0` ingests as `golang-json`, publishing per-suite check runs alongside the existing logs (requires the new `checks: write` permission). gotestsum is added via `go get -tool` so contributors invoke it through `go tool gotestsum` without a separate install. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
When a workflow run is cancelled mid-test (e.g. concurrency cancel from a follow-up push), gotestsum's --jsonfile is left without a final elapsed-bearing event. The publish steps still ran under 'if: always() && ...' and dorny/test-reporter then errored with "missing elapsed on final test event", clobbering the run with a red annotation that has nothing to do with the actual test results. Switch the conditions to !cancelled() so we only publish when there's a real, complete result file to parse; success and failure paths still publish as before.
roborev: Combined Review (
|
Summary
gotestsum --format pkgname-and-test-fails --jsonfile, publishing per-suite check runs throughdorny/test-reporter@v2.7.0(golang-json).make test,test-short,test-integration, andtest-gitlab-containeruse the same gotestsum invocation, writing JSON event logs totmp/.go get -tool gotest.tools/gotestsum), so contributors invoke it asgo tool gotestsumwithout a separate install.hideWhitespace=trueno longer return whitespace-only modifications.git diff --rawignores-w(compares blob SHAs); we now treat the--numstatmap as ground truth and drop "modified" entries that aren't in it.🤖 Generated with Claude Code