Skip to content

local e2e tests - check if smoke-test to prevent jest watching #1739

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

Closed
tuchk4 opened this issue Mar 6, 2017 · 5 comments
Closed

local e2e tests - check if smoke-test to prevent jest watching #1739

tuchk4 opened this issue Mar 6, 2017 · 5 comments

Comments

@tuchk4
Copy link
Contributor

tuchk4 commented Mar 6, 2017

Now --watch flag for jest tests is disabled in two cases (scripts/test.js#L25):

  • is CI
  • or --coverage is added

but when run npm run e2e locally - tests always stops at first npm test - tasks/e2e-simple.sh#L117

Maybe add isSmokeTest check like at utils/createWebpackCompiler.js#L11?

// Watch unless on CI or in coverage mode
const isSmokeTest = process.argv.some(arg => arg.indexOf('--smoke-test') > -1)
if (!isSmokeTest && !process.env.CI && argv.indexOf('--coverage') < 0) {
  argv.push('--watch');
}
@tuchk4 tuchk4 changed the title local e2e tests - support smoke-test flag prevent jest watching local e2e tests - check if smoke-test to prevent jest watching Mar 6, 2017
@gaearon
Copy link
Contributor

gaearon commented Mar 6, 2017

Can we change local e2e to set CI to true?
Also, how did this ever work?

@tuchk4
Copy link
Contributor Author

tuchk4 commented Mar 6, 2017

There are two places in code where process.env.CI is using:

So it is possible to prevent jest watching using this CI=true npm run e2e.
Same way as here - #1460 (comment)

CI is set at *.sh tasks

@tuchk4
Copy link
Contributor Author

tuchk4 commented Mar 6, 2017

Found it.

All npm test are run with CI=true except this one e2e-simple.sh#L266
(I thought that CI is automatically set by travis)

@tuchk4
Copy link
Contributor Author

tuchk4 commented Mar 6, 2017

All is clear now. But I am confused a bit.
We have --smoke-test, CI env variable but for comfortable local test runs I should add at least two (CI=true and BROWSER=none) env variables.

@gaearon
Copy link
Contributor

gaearon commented Mar 6, 2017

Send a PR as you see fit. I don’t use local testing much so it might be broken.

@gaearon gaearon closed this as completed Jan 8, 2018
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants