Skip to content

Commit a08d29c

Browse files
authored
chore: add Codecov Test Analytics (#84) (#86)
- Add jest-junit reporter for JUnit XML output - Update CI workflow to upload test results to Codecov - Enables flaky test detection and test performance tracking Stu Mason + AI <me@stumason.dev>
1 parent 5b5ca4b commit a08d29c

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,12 @@ jobs:
5050
files: ./coverage/lcov.info
5151
fail_ci_if_error: false
5252
verbose: true
53+
54+
- name: Upload test results to Codecov
55+
if: matrix.node-version == '20.x'
56+
uses: codecov/test-results-action@v1
57+
with:
58+
token: ${{ secrets.CODECOV_TOKEN }}
59+
files: ./coverage/junit.xml
60+
fail_ci_if_error: false
61+
verbose: true

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- **Codecov Test Analytics** - Enable test result tracking (#84):
13+
- Added `jest-junit` reporter for JUnit XML output
14+
- CI workflow now uploads test results to Codecov
15+
- Enables flaky test detection and test performance tracking
16+
1017
### Fixed
1118

1219
- **Deployment Logs Massive Payload** - Add character-based truncation (#82):

jest.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ export default {
2424
],
2525
coverageDirectory: 'coverage',
2626
coverageReporters: ['text', 'text-summary', 'lcov'],
27+
reporters: [
28+
'default',
29+
[
30+
'jest-junit',
31+
{
32+
outputDirectory: 'coverage',
33+
outputName: 'junit.xml',
34+
},
35+
],
36+
],
2737
coverageThreshold: {
2838
global: {
2939
statements: 80,

package-lock.json

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"globals": "^17.0.0",
6060
"husky": "^9.0.11",
6161
"jest": "^29.7.0",
62+
"jest-junit": "^16.0.0",
6263
"lint-staged": "^16.2.7",
6364
"markdownlint-cli2": "^0.20.0",
6465
"prettier": "^3.5.3",

0 commit comments

Comments
 (0)