Setting Flags for monorepo projects
See original GitHub issueIssue Description
I have a Lerna
Monorepo setup where I have packages in two folders:
root/platform/project-name/
root/extensions/project-name/
Upload All Reports From Root
I first tried using Jest’s multiproject runner, and then rely on .codecov.yml
to properly split the one coverage report. Each project generates it’s coverage report, then the parent project runs codecov
:
overage:
status:
project:
default:
threshold: 0.10%
core:
flags: core
ui:
flags: ui
cornerstone:
flags: cornerstone
patch: off
flags:
core:
paths:
- platform/core/src
ui:
paths:
- platform/ui/src
cornerstone:
paths:
- extensions/cornerstone/src
I see the following output in CI:
lerna success - ohif-core
lerna success - @ohif/i18n
lerna success - react-viewerbase
lerna success - ohif-viewer
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v3.5.0
==> Detecting CI Provider
Circle CI Detected
==> Configuration:
Endpoint: https://codecov.io
{ commit: '3acea218fbc52e1f6fc010ff8ef501e4444cb57b',
branch: 'pull/629',
package: 'node-v3.5.0' }
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
$ find /home/circleci/repo -type f -name '*.gcno' -exec gcov {} +
==> Scanning for reports
+ /home/circleci/repo/platform/core/coverage/lcov.info
+ /home/circleci/repo/platform/core/coverage/clover.xml
+ /home/circleci/repo/platform/viewer/coverage/lcov.info
+ /home/circleci/repo/platform/viewer/coverage/clover.xml
+ /home/circleci/repo/platform/ui/coverage/lcov.info
+ /home/circleci/repo/platform/ui/coverage/clover.xml
==> Uploading reports
Success!
View report at: https://codecov.io/github/OHIF/Viewers/commit/3acea218fbc52e1f6fc010ff8ef501e4444cb57b
The GitHub reporter shows each project, but assumes the coverage report applies entirely to each project.
Upload Reports Individually
After running into issues with the above, I modified each project to upload it’s report individually, and to specify it’s flag/
Run once, for each project:
jest --ci --runInBand --collectCoverage && codecov --flags=someflag
CI reports the files as having been uploaded, but codecov shows an error/issue in the dashboard.
There was an error processing coverage reports.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Because, if you are using Firefox, it needs to be renamed to
*.txt.gz
and extracted. The header and the filename aren’t in agreement, it’s on our backlog. If using Chrome, it’s similar, but in reverse, I believe.I’ll take a look Monday, but we do currently have an issue where if the YAML fails validation it is silently ignored.
That said, you should be able to view the raw reports from the build tab of the commit page on Codecov by clicking download for the build job that uploaded them