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

ci: produce jest xml reports only in azure pipelines #10160

Merged
merged 3 commits into from
Nov 27, 2018

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Nov 27, 2018

temporary alternative to #10140 (until ci-info supports azure pipelines)

/cc @DSchau

DSchau and others added 2 commits November 26, 2018 11:01
In gatsbyjs#10128, we added test report tasks to Azure pipelines. Unfortunately,
this adds some additional overhead and coverage type stuff in _local_
development that we probably don't want.

This PR addresses this issue, and conditionally detects whether running
in CI. If running in CI (e.g. Azure Pipelines, Circle, etc.) it will add
the additional coverage reporter and coverage functionality.

Note: this is currently blocked by watson/ci-info#22
Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

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

Looks good. Left a comment!

jest.config.js Outdated
@@ -31,7 +31,7 @@ module.exports = {
moduleNameMapper: {
"^highlight.js$": `<rootDir>/node_modules/highlight.js/lib/index.js`,
},
collectCoverage: true,
collectCoverage: !!process.env.GENERATE_JEST_REPORT,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, but could we hoist this up to something like

const useCoverage = !!process.env.GENERATE_JEST_REPORT

// use elsewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 done (at least I hope I did what you meant ;) )

Copy link
Contributor

Choose a reason for hiding this comment

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

exactly :)

@DSchau DSchau merged commit aca36fe into gatsbyjs:master Nov 27, 2018
@pieh pieh deleted the ci/coverage branch November 27, 2018 15:53
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
* test: do not report coverage unless in CI

In gatsbyjs#10128, we added test report tasks to Azure pipelines. Unfortunately,
this adds some additional overhead and coverage type stuff in _local_
development that we probably don't want.

This PR addresses this issue, and conditionally detects whether running
in CI. If running in CI (e.g. Azure Pipelines, Circle, etc.) it will add
the additional coverage reporter and coverage functionality.

Note: this is currently blocked by watson/ci-info#22

* add GENERATE_JEST_REPORT env var and use it with azure pipelines

* use var to hold normalized (boolean) val from env var
@pieh pieh restored the ci/coverage branch May 17, 2020 20:43
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