-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: enable unit test coverage comment #2637
Changes from all commits
1f4a679
075f79f
f04f3ca
38afdf5
585a689
576db9f
43b9fc3
008127d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,10 @@ jobs: | |
|
||
- uses: ./.github/workflows/yarn | ||
|
||
- name: Run tests | ||
run: 'yarn test:ci' | ||
|
||
- name: Comment in failing tests | ||
uses: mattallty/jest-github-action@v1.0.3 | ||
if: failure() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Annotations and coverage report | ||
uses: ArtiomTr/jest-coverage-report-action@v2 | ||
with: | ||
test-command: 'echo unit tests already executed' | ||
coverage-comment: false | ||
skip-step: install | ||
package-manager: yarn | ||
test-script: yarn test:ci | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The docs of the coverage tool suggest to use this together with https://github.com/marocchino/sticky-pull-request-comment Such that there is only one coverage comment that gets updated on change instead of having a new comment on each run. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It keeps a single comment already, those two other comments in this PR are due to a different configuration while I was testing it. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"prettier": "prettier -w \"{src,cypress,mocks,scripts}/**/*.{ts,tsx,css,js}\"", | ||
"fix": "yarn lint:fix && ts-prune && yarn prettier", | ||
"test": "cross-env TZ=CET DEBUG_PRINT_LIMIT=30000 jest", | ||
"test:ci": "yarn test --ci --silent --coverage --json --watchAll=false --testLocationInResults --outputFile=jest.results.json", | ||
"test:ci": "yarn test --ci --silent --coverage --json --watchAll=false --testLocationInResults --outputFile=report.json", | ||
"test:coverage": "yarn test --coverage --watchAll=false", | ||
"cmp": "./scripts/cmp.sh", | ||
"routes": "node scripts/generate-routes.js > src/config/routes.ts && prettier -w src/config/routes.ts && cat src/config/routes.ts", | ||
|
@@ -32,9 +32,6 @@ | |
"engines": { | ||
"node": ">=16" | ||
}, | ||
"pre-commit": [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we discuss this? It feels out of scope of the coverage report. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's dicuss it, yes. I'll start a thread on Slack. |
||
"lint" | ||
], | ||
"resolutions": { | ||
"@web3-onboard/trezor/**/protobufjs": "^7.2.4" | ||
}, | ||
|
@@ -124,7 +121,6 @@ | |
"fake-indexeddb": "^4.0.2", | ||
"jest": "^29.6.2", | ||
"jest-environment-jsdom": "^29.6.2", | ||
"pre-commit": "^1.2.2", | ||
"prettier": "^2.7.0", | ||
"ts-node": "^10.8.2", | ||
"ts-prune": "^0.10.3", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we are not using Coveralls? It seems that we already have some projects on there: https://coveralls.io/github/safe-global
It should be free for open-source projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the point of depending on a 3rd-party service for something available locally.