Skip to content

Commit

Permalink
feat(ci): Add junit reporters to jest/vitest, codecov test results
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed Feb 7, 2025
1 parent 3c4df06 commit a375268
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
if: cancelled() == false
continue-on-error: true
uses: codecov/test-results-action@v1
with:
directory: packages/remix
token: ${{ secrets.CODECOV_TOKEN }}

job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
Expand Down Expand Up @@ -701,6 +709,14 @@ jobs:
working-directory: dev-packages/node-integration-tests
run: yarn test

- name: Upload test results to Codecov
if: cancelled() == false
continue-on-error: true
uses: codecov/test-results-action@v1
with:
directory: dev-packages/node-integration-tests
token: ${{ secrets.CODECOV_TOKEN }}

job_remix_integration_tests:
name: Remix (Node ${{ matrix.node }}) Tests
needs: [job_get_metadata, job_build]
Expand Down Expand Up @@ -737,6 +753,14 @@ jobs:
cd packages/remix
yarn test:integration:ci
- name: Upload test results to Codecov
if: cancelled() == false
continue-on-error: true
uses: codecov/test-results-action@v1
with:
directory: packages/remix
token: ${{ secrets.CODECOV_TOKEN }}

job_e2e_prepare:
name: Prepare E2E tests
# We want to run this if:
Expand Down
9 changes: 9 additions & 0 deletions jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ module.exports = {
...(process.env.CI
? {
coverageReporters: ['json', 'lcov', 'clover'],
reporters: [
'default',
[
'jest-junit',
{
outputName: 'jest.junit.xml',
},
],
],
}
: {}),
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
"eslint": "7.32.0",
"jest": "^27.5.1",
"jest-environment-node": "^27.5.1",
"jest-junit": "^16.0.0",
"jsdom": "^21.1.2",
"lerna": "7.1.1",
"madge": "7.0.0",
Expand Down
1 change: 1 addition & 0 deletions vite/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default defineConfig({
enabled: true,
reportsDirectory: './coverage',
},
reporters: ['default', 'junit'],
typecheck: {
tsconfig: './tsconfig.test.json',
},
Expand Down
15 changes: 15 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19066,6 +19066,16 @@ jest-jasmine2@^27.5.1:
pretty-format "^27.5.1"
throat "^6.0.1"

jest-junit@^16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-16.0.0.tgz#d838e8c561cf9fdd7eb54f63020777eee4136785"
integrity sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==
dependencies:
mkdirp "^1.0.4"
strip-ansi "^6.0.1"
uuid "^8.3.2"
xml "^1.0.1"

jest-leak-detector@^27.5.1:
version "27.5.1"
resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8"
Expand Down Expand Up @@ -30490,6 +30500,11 @@ xml-name-validator@^4.0.0:
resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835"
integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==

xml@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==

xmlchars@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"
Expand Down

0 comments on commit a375268

Please sign in to comment.