Skip to content

Commit a375268

Browse files
committed
feat(ci): Add junit reporters to jest/vitest, codecov test results
1 parent 3c4df06 commit a375268

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,14 @@ jobs:
381381
with:
382382
token: ${{ secrets.CODECOV_TOKEN }}
383383

384+
- name: Upload test results to Codecov
385+
if: cancelled() == false
386+
continue-on-error: true
387+
uses: codecov/test-results-action@v1
388+
with:
389+
directory: packages/remix
390+
token: ${{ secrets.CODECOV_TOKEN }}
391+
384392
job_bun_unit_tests:
385393
name: Bun Unit Tests
386394
needs: [job_get_metadata, job_build]
@@ -701,6 +709,14 @@ jobs:
701709
working-directory: dev-packages/node-integration-tests
702710
run: yarn test
703711

712+
- name: Upload test results to Codecov
713+
if: cancelled() == false
714+
continue-on-error: true
715+
uses: codecov/test-results-action@v1
716+
with:
717+
directory: dev-packages/node-integration-tests
718+
token: ${{ secrets.CODECOV_TOKEN }}
719+
704720
job_remix_integration_tests:
705721
name: Remix (Node ${{ matrix.node }}) Tests
706722
needs: [job_get_metadata, job_build]
@@ -737,6 +753,14 @@ jobs:
737753
cd packages/remix
738754
yarn test:integration:ci
739755
756+
- name: Upload test results to Codecov
757+
if: cancelled() == false
758+
continue-on-error: true
759+
uses: codecov/test-results-action@v1
760+
with:
761+
directory: packages/remix
762+
token: ${{ secrets.CODECOV_TOKEN }}
763+
740764
job_e2e_prepare:
741765
name: Prepare E2E tests
742766
# We want to run this if:

jest/jest.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ module.exports = {
2828
...(process.env.CI
2929
? {
3030
coverageReporters: ['json', 'lcov', 'clover'],
31+
reporters: [
32+
'default',
33+
[
34+
'jest-junit',
35+
{
36+
outputName: 'jest.junit.xml',
37+
},
38+
],
39+
],
3140
}
3241
: {}),
3342
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
"eslint": "7.32.0",
120120
"jest": "^27.5.1",
121121
"jest-environment-node": "^27.5.1",
122+
"jest-junit": "^16.0.0",
122123
"jsdom": "^21.1.2",
123124
"lerna": "7.1.1",
124125
"madge": "7.0.0",

vite/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default defineConfig({
1010
enabled: true,
1111
reportsDirectory: './coverage',
1212
},
13+
reporters: ['default', 'junit'],
1314
typecheck: {
1415
tsconfig: './tsconfig.test.json',
1516
},

yarn.lock

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19066,6 +19066,16 @@ jest-jasmine2@^27.5.1:
1906619066
pretty-format "^27.5.1"
1906719067
throat "^6.0.1"
1906819068

19069+
jest-junit@^16.0.0:
19070+
version "16.0.0"
19071+
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-16.0.0.tgz#d838e8c561cf9fdd7eb54f63020777eee4136785"
19072+
integrity sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==
19073+
dependencies:
19074+
mkdirp "^1.0.4"
19075+
strip-ansi "^6.0.1"
19076+
uuid "^8.3.2"
19077+
xml "^1.0.1"
19078+
1906919079
jest-leak-detector@^27.5.1:
1907019080
version "27.5.1"
1907119081
resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8"
@@ -30490,6 +30500,11 @@ xml-name-validator@^4.0.0:
3049030500
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835"
3049130501
integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==
3049230502

30503+
xml@^1.0.1:
30504+
version "1.0.1"
30505+
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
30506+
integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==
30507+
3049330508
xmlchars@^2.2.0:
3049430509
version "2.2.0"
3049530510
resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"

0 commit comments

Comments
 (0)