1
0

Jump directly to failure in gotestfmt

This commit is contained in:
David Robertson
2022-07-05 14:29:24 +01:00
parent 347165bc06
commit b3a72a6ecc

View File

@@ -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 . -}}