Skip to content
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

feat(testing): add codecov to generate test coverage reports #3194

Merged
merged 3 commits into from Apr 22, 2021

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Apr 22, 2021

This PR adds support to generate test coverage reports on PRs using @codecov

Changes

  • add CODECOV_TOKEN secret to project
  • add clover to coverageReporters for unit tests (see jest key on package.json)
  • add codecov as dev dependency
  • add coverage script to package.json
  • add ci step to run yarn coverage

Screenshots

todo

Checklist

  • dependencies added

Fixes #3151

Codecov requires .xml format.

We can get this from Jest by adding "clover"
to our coverageReporters.
@jsjoeio jsjoeio added the testing Anything related to testing label Apr 22, 2021
@jsjoeio jsjoeio added this to the v3.9.4 milestone Apr 22, 2021
@jsjoeio jsjoeio self-assigned this Apr 22, 2021
@jsjoeio jsjoeio requested a review from a team as a code owner April 22, 2021 22:11
@jsjoeio jsjoeio added this to 🚧 In progress in Improve Testing via automation Apr 22, 2021
@jsjoeio jsjoeio marked this pull request as draft April 22, 2021 22:11
@@ -139,7 +139,8 @@
"coverageReporters": [
"json",
"json-summary",
"text"
"text",
"clover"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about clover! very cool. from this config it looks like collecting JS test coverage metrics isn't too difficult! definitely something we'd love to get your guidance with on the product side, I think, at some point :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right?! I think it should be pretty easy. I believe I just need to install codecov then run it in CI and it should upload the results for us.

Would be more than happy to help on the product side :D

@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@72ca12c). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3194   +/-   ##
=======================================
  Coverage        ?   46.77%           
=======================================
  Files           ?       23           
  Lines           ?     1193           
  Branches        ?      237           
=======================================
  Hits            ?      558           
  Misses          ?      451           
  Partials        ?      184           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72ca12c...bb0414e. Read the comment docs.

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Apr 22, 2021

❗ No coverage uploaded for pull request base (main@72ca12c). Click here to learn what that means.
The diff coverage is n/a.

I believe this is because it's looking for code coverage on the main branch which we don't have since this is the first time we're adding it 😂

Source

@jsjoeio jsjoeio marked this pull request as ready for review April 22, 2021 22:38
@jsjoeio jsjoeio added the merge when passing Merge the PR automatically once all status checks have passed label Apr 22, 2021
@repo-ranger repo-ranger bot merged commit 5ad8e68 into main Apr 22, 2021
Improve Testing automation moved this from 🚧 In progress to ✅ Done Apr 22, 2021
@repo-ranger repo-ranger bot deleted the jsjoeio/add-code-coverage-reporter branch April 22, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when passing Merge the PR automatically once all status checks have passed testing Anything related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[dev]: add Codecov to track testing code coverage
2 participants