Skip to content

Commit 28079ad

Browse files
committed
ci: Output tail of gotestsum.json if test timed out
This is to eternalize the log in case "re-run failed" is used, which erases artifacts from previous run.
1 parent ec2293a commit 28079ad

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/coder.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,16 @@ jobs:
338338
else
339339
echo ::set-output name=cover::false
340340
fi
341-
set -x
342341
gotestsum --junitfile="gotests.xml" --jsonfile="gotestsum.json" --packages="./..." --debug -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS
342+
ret=$?
343+
if ((ret)); then
344+
# Eternalize test timeout logs because "re-run failed" erases
345+
# artifacts and gotestsum doesn't always capture it:
346+
# https://github.com/gotestyourself/gotestsum/issues/292
347+
echo "Checking gotestsum.json for panic trace:"
348+
grep -A 999999 'panic: test timed out' gotestsum.json
349+
fi
350+
exit $ret
343351
344352
- uses: actions/upload-artifact@v3
345353
if: success() || failure()

0 commit comments

Comments
 (0)