summaryrefslogtreecommitdiffstats
path: root/extras/hs-test/hs_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extras/hs-test/hs_test.sh')
-rw-r--r--extras/hs-test/hs_test.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/extras/hs-test/hs_test.sh b/extras/hs-test/hs_test.sh
index c53c5a9de88..c72ef73301e 100644
--- a/extras/hs-test/hs_test.sh
+++ b/extras/hs-test/hs_test.sh
@@ -124,5 +124,16 @@ mkdir -p summary
# shellcheck disable=SC2086
sudo -E go run github.com/onsi/ginkgo/v2/ginkgo --json-report=summary/report.json $ginkgo_args -- $args
-jq -r '.[0] | .SpecReports[] | select((.State == "failed") or (.State == "timedout") or (.State == "panicked")) | select(.Failure != null) | "TestName: \(.LeafNodeText)\nSuite:\n\(.Failure.FailureNodeLocation.FileName)\nMessage:\n\(.Failure.Message)\n Full Stack Trace:\n\(.Failure.Location.FullStackTrace)\n"' summary/report.json > summary/failed-summary.log \
+if [ $? != 0 ]; then
+ jq -r '.[0] | .SpecReports[] | select((.State == "failed") or (.State == "timedout") or (.State == "panicked")) | select(.Failure != null) |
+"TestName:
+ \(.LeafNodeText)
+Suite:
+ \(.Failure.FailureNodeLocation.FileName)
+Message:
+\(.Failure.Message)"
+ + (if .Failure.Message == "A spec timeout occurred" then "\n" else
+"\nFull Stack Trace:
+\(.Failure.Location.FullStackTrace)\n" end)' summary/report.json > summary/failed-summary.log \
&& echo "Summary generated -> summary/failed-summary.log"
+fi