-
Notifications
You must be signed in to change notification settings - Fork 141
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
Adding codecov uploading to github and buildkite with monorepo flags #1146
Conversation
|
packages/config/src/jest/config.js
Outdated
@@ -22,6 +22,9 @@ const createJestTSConfig = ( | |||
* No need to manually run yarn build all the time. | |||
* This resolve packages for ts-jest so typescript compilation happens in-memory. | |||
*/ | |||
collectCoverage: process.env.CI === true, |
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.
This causes some spurrious validation warnings. I didn't see a definitive answer about whether a new jest version would solve it. We can add --coverage to the test command lines instead
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.
...([process.env.CI, process.env.COVERAGE].includes('true') && isRootConfig
? { collectCoverage: true }
: {}),
coverageDirectory: '<rootDir>/coverage',
I've tested this --
Observations on this config:
-
on Buildkite/CI, when
yarn run -T core test
is run -- the coverage directory is in the packages/core. I am not sure that codecov can handle a bunch of individual "coverage" folders like that, or it can only handle one big honking coverage folder. Sticking with this pattern would be ideal. -
We also support running
yarn test --coverage
at the monorepo root (which is a currently not a command we run on CI) which runs the test suite on every package -- and creates an aggregated coverage folder. We only don't do this on CI because we like having the CI steps be more atomic (test core, test browser, etc) -- it also is more flexible in the future if want to power up turborepo with distributed build caching.
I'm still kinda on the fence about whether we or not we should use the CI env variable for coverage, or whether that's confusing and we use the new COVERAGE env variable. (or ditch the process.env.CI and just run with --coverage, or, all three). There's too many ways to do this ;-)
…to MichaelGHSeg/codecov
yarn changeset
. Read about changesets here).