From b3a72a6ecc0324e14b47565cae3c0c2e4e8d6e00 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 5 Jul 2022 14:29:24 +0100 Subject: [PATCH 1/2] Jump directly to failure in gotestfmt --- .ci/complement_package.gotpl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.ci/complement_package.gotpl b/.ci/complement_package.gotpl index e1625fd31fe4..d189fc9ac486 100644 --- a/.ci/complement_package.gotpl +++ b/.ci/complement_package.gotpl @@ -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 . -}} From 4ecbaed94b1a1977b4e8810157b425952efb9bee Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 5 Jul 2022 14:32:31 +0100 Subject: [PATCH 2/2] Changelog --- changelog.d/13180.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/13180.misc diff --git a/changelog.d/13180.misc b/changelog.d/13180.misc new file mode 100644 index 000000000000..14609dc47c3b --- /dev/null +++ b/changelog.d/13180.misc @@ -0,0 +1 @@ +Jump directly to failure in `gotestfmt` output.