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

Run coverage at the end of jest and configure thresholds #8371

Conversation

oorestisime
Copy link
Contributor

So i enabled (again it seems) the coverage tests and added a threshold using jest-coverage-ratchet

Questions for improvement

  1. should i add thresholds for each package not just a global feel?
  2. there is a prepush hook to configure with jest-coverage-ratchet to automatically adjust the thresholds. i could look how to add that
  3. if the answer for 2 is no then i am not sure i should add jest-coverage-ratchet in dependencies

@oorestisime
Copy link
Contributor Author

I was trying to look at which packages lack in tests and i realized that the current configuration was lacking since it wasn't getting the coverage from all available sources hence i modified it.

In addition i ve remove ratchet since i dont feel like it is really useful in the end.

Copy link
Contributor

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

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

Thanks @oorestisime, this looks great 👍

I've switched this over to default to coverage off, with a new npm command to run tests with coverage. I think that gives us a good chance to experiment with running this in CI, and using different threshold levels, along with maybe adding jest-coverage-ratchet back in?

Regarding threshold levels - maybe the next step could be to pick out some core packages and group them together with one threshold setting. Then use a separate threshold for everything else.

A list of 'core' packages might be something like:

  • babel-plugin-remove-graphql-queries
  • gatsby
  • gatsby-image
  • gatsby-link
  • gatsby-plugin-page-creator
  • gatsby-plugin-sharp

@oorestisime
Copy link
Contributor Author

Yes definitely! I can play again with threshold levels later today and get back here!

@m-allanson
Copy link
Contributor

Merging, thank you!

@m-allanson m-allanson merged commit bc1a79d into gatsbyjs:master Sep 27, 2018
@oorestisime oorestisime mentioned this pull request Sep 27, 2018
lipis added a commit to lipis/gatsby that referenced this pull request Sep 27, 2018
* 'master' of github.com:gatsbyjs/gatsby:
  Add blog post on v2 reach router (gatsbyjs#8508)
  feat: add self to community page (gatsbyjs#8572)
  feat: update sites.yml (gatsbyjs#8589)
  Add an example to the sourceNodes docs (gatsbyjs#8585)
  chore(release): Publish
  fix: add compat fix for gatsby-cli v2 with gatsby v1 (gatsbyjs#8581)
  fix: fix unhandled rejection when no browser found when running with --open flag (gatsbyjs#8507)
  Fix writing out new page information (so new pages hot reload) during development (gatsbyjs#8570)
  Run coverage at the end of jest and configure thresholds (gatsbyjs#8371)
  chore(release): Publish
  chore: update gatsby-source-drupal version in using-drupal example (gatsbyjs#8497)
  Typo fix in gatsby-source-graphql/README.md (gatsbyjs#8562)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants