Skip to content

Commit 241b036

Browse files
authored
Merge pull request #313 from scratchfoundation/make-test-failures-visible
Report test results more visibly
2 parents 457ff70 + 44cb5f9 commit 241b036

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

.github/actions/test-package/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ runs:
1919
- name: Test
2020
working-directory: ./packages/${{ inputs.package_name }}
2121
shell: bash
22+
env:
23+
TAP_REPORTER: "junit"
24+
TAP_REPORTER_FILE: "test-results/junit.xml"
2225
run: |
2326
mkdir -p test-results
24-
npm run test | tee -a ./test-results/${{ inputs.package_name }}-test-results.txt
27+
npm run test
28+
- name: Publish test reports
29+
if: ${{ !cancelled() }}
30+
uses: EnricoMi/publish-unit-test-result-action@v2
31+
with:
32+
files: "./packages/${{ inputs.package_name }}/test-results/**/*"
33+
check_name: "Test report for ${{ inputs.package_name }}"
34+
test_file_prefix: "+packages/${{ inputs.package_name }}/"
2535
- name: Store Test Results
2636
if: ${{ !cancelled() }}
2737
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
name: Results
9292
runs-on: ubuntu-latest
9393
needs: test
94-
if: ${{ always() }}
94+
if: ${{ !cancelled() }}
9595
steps:
9696
- run: |
9797
case "${{ needs.test.result }}" in

packages/scratch-gui/.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ npm-*
88
# Testing
99
/.nyc_output
1010
/coverage
11+
/test-results
1112

1213
# Build
1314
/build
@@ -26,6 +27,3 @@ npm-*
2627

2728
# for act
2829
.secrets
29-
30-
# Generated test results
31-
/test-results

packages/scratch-render/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ npm-*
99
/.nyc_output
1010
/.tap
1111
/coverage
12+
/test-results
1213

1314
# IDEA
1415
/.idea

packages/scratch-svg-renderer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ npm-*
1111

1212
# Test
1313
/.tap
14+
/test-results
1415

1516
# Editors
1617
/#*

packages/scratch-vm/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ npm-*
99
/.nyc_output
1010
/.tap
1111
/coverage
12+
/test-results
1213

1314
# Editor
1415
/.idea

0 commit comments

Comments
 (0)