Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Jump directly to failure in gotestfmt #13180

Closed
wants to merge 2 commits into from
Closed
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
13 changes: 13 additions & 0 deletions .ci/complement_package.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ which is under the Unlicense licence.
{{- with .Output -}}
{{- . -}}{{- "\n" -}}
{{- end -}}

{{- /* Output an error marker if there are any failing tests, so GitHub will skip straight to them */ -}}
{{- $anyFailures := false -}}
{{- range .TestCases -}}
{{- if and (ne .Result "PASS") (ne .Result "SKIP") -}}
{{- $anyFailures = true -}}
{{- end -}}
{{- end -}}
{{- if $anyFailures -}}
::error title=Test Failures::At least one test failed
{{- printf "\n" -}}
{{- end -}}

{{- with .TestCases -}}
{{- /* Failing tests are first */ -}}
{{- range . -}}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/13180.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Jump directly to failure in `gotestfmt` output.