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

Commit

Permalink
Jump directly to failure in gotestfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Jul 12, 2022
1 parent 347165b commit b3a72a6
Showing 1 changed file with 13 additions and 0 deletions.
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

0 comments on commit b3a72a6

Please sign in to comment.