Skip to content

Commit a973c35

Browse files
authored
chore: collect gotestsum TestEvents as workflow artifacts (coder#5336)
1 parent 3cea5f9 commit a973c35

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.github/workflows/coder.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,14 @@ jobs:
336336
echo ::set-output name=cover::false
337337
fi
338338
set -x
339-
gotestsum --junitfile="gotests.xml" --packages="./..." --debug -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS
339+
gotestsum --junitfile="gotests.xml" --jsonfile="gotestsum.json" --packages="./..." --debug -- -parallel=8 -timeout=3m -short -failfast $COVERAGE_FLAGS
340+
341+
- uses: actions/upload-artifact@v3
342+
if: success() || failure()
343+
with:
344+
name: gotestsum-debug-${{ matrix.os }}.json
345+
path: ./gotestsum.json
346+
retention-days: 7
340347

341348
- uses: codecov/codecov-action@v3
342349
# This action has a tendency to error out unexpectedly, it has
@@ -399,6 +406,13 @@ jobs:
399406
- name: Test with PostgreSQL Database
400407
run: make test-postgres
401408

409+
- uses: actions/upload-artifact@v3
410+
if: success() || failure()
411+
with:
412+
name: gotestsum-debug-postgres.json
413+
path: ./gotestsum.json
414+
retention-days: 7
415+
402416
- uses: codecov/codecov-action@v3
403417
# This action has a tendency to error out unexpectedly, it has
404418
# the `fail_ci_if_error` option that defaults to `false`, but

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ vendor
1515
yarn-error.log
1616
gotests.coverage
1717
gotests.xml
18+
gotestsum.json
1819
.idea
1920
.gitpod.yml
2021
.DS_Store

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,10 @@ test: test-clean
471471
test-postgres: test-clean test-postgres-docker
472472
# The postgres test is prone to failure, so we limit parallelism for
473473
# more consistent execution.
474-
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." -- \
474+
DB=ci DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum \
475+
--junitfile="gotests.xml" \
476+
--jsonfile="gotestsum.json" \
477+
--packages="./..." -- \
475478
-covermode=atomic -coverprofile="gotests.coverage" -timeout=20m \
476479
-parallel=4 \
477480
-coverpkg=./... \

0 commit comments

Comments
 (0)