Skip to content

ci: Output tail of gotestsum.json if test timed out #5411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/workflows/coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,16 @@ jobs:
else
echo ::set-output name=cover::false
fi
set -x
gotestsum --junitfile="gotests.xml" --jsonfile="gotestsum.json" --packages="./..." --debug -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS
ret=$?
if ((ret)); then
# Eternalize test timeout logs because "re-run failed" erases
# artifacts and gotestsum doesn't always capture it:
# https://github.com/gotestyourself/gotestsum/issues/292
echo "Checking gotestsum.json for panic trace:"
grep -A 999999 'panic: test timed out' gotestsum.json
fi
exit $ret

- uses: actions/upload-artifact@v3
if: success() || failure()
Expand Down Expand Up @@ -407,7 +415,17 @@ jobs:
terraform_wrapper: false

- name: Test with PostgreSQL Database
run: make test-postgres
run: |
make test-postgres
ret=$?
if ((ret)); then
# Eternalize test timeout logs because "re-run failed" erases
# artifacts and gotestsum doesn't always capture it:
# https://github.com/gotestyourself/gotestsum/issues/292
echo "Checking gotestsum.json for panic trace:"
grep -A 999999 'panic: test timed out' gotestsum.json
fi
exit $ret

- uses: actions/upload-artifact@v3
if: success() || failure()
Expand Down