mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
ci: Output tail of gotestsum.json if test timed out (#5411)
This is to eternalize the log in case "re-run failed" is used, which erases artifacts from previous run.
This commit is contained in:
@@ -338,8 +338,16 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo ::set-output name=cover::false
|
echo ::set-output name=cover::false
|
||||||
fi
|
fi
|
||||||
set -x
|
|
||||||
gotestsum --junitfile="gotests.xml" --jsonfile="gotestsum.json" --packages="./..." --debug -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS
|
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
|
- uses: actions/upload-artifact@v3
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
@@ -407,7 +415,17 @@ jobs:
|
|||||||
terraform_wrapper: false
|
terraform_wrapper: false
|
||||||
|
|
||||||
- name: Test with PostgreSQL Database
|
- 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
|
- uses: actions/upload-artifact@v3
|
||||||
if: success() || failure()
|
if: success() || failure()
|
||||||
|
|||||||
Reference in New Issue
Block a user