Wp-calypso: Skipping chromedriver download (as suggested by calypso-doctor) doesn't allow e2e tests to run locally

Created on 10 Sep 2020  Â·  6Comments  Â·  Source: Automattic/wp-calypso

Steps to reproduce

When running yarn calypso-doctor, one of the suggestions is to export CHROMEDRIVER_SKIP_DOWNLOAD=true to the .zshrc file (or its equivalent)

With this flag set up as per instructions, I'm not able to run e2e tests. Instead, I get an error about chromedriver not being found in /wp-calypso/node_modules/chromedriver/lib/chromedriver/chromedriver

Actions taken

I was able to run tests successfully by:

  • deleting export CHROMEDRIVER_SKIP_DOWNLOAD=true from my .zshrc file
  • refreshing the shell
  • deleting ./node_modules and ./tests/e2e/node_modules/
  • re-running yarn install in the project root and in the tests/e2e/ folders

Context

The same issue was reported by at least another developer cc @cpapazoglou (see paYJgx-Ws-p2#comment-1201)

Documentation Testing [Pri] Low [Type] Task

Most helpful comment

Running CHROMEDRIVER_SKIP_DOWNLOAD='' yarn --force should fix the issue for you.

Some thoughts:

  • Chromedriver install is really slow and not needed most of the time, I think we should continue to optimize for that like calypso doctor suggests.
  • We can document the workaround better.
  • Ideally, this is automated. We may be able to invoke the pupeteer's install script with the disable download env variable removed as part of mocha setup. Take a look at the approach here: https://github.com/WordPress/gutenberg/pull/25112

re-running yarn install in the project root and in the tests/e2e/ folders

I don't believe where you run yarn (install) is relevant.

All 6 comments

Running CHROMEDRIVER_SKIP_DOWNLOAD='' yarn --force should fix the issue for you.

Some thoughts:

  • Chromedriver install is really slow and not needed most of the time, I think we should continue to optimize for that like calypso doctor suggests.
  • We can document the workaround better.
  • Ideally, this is automated. We may be able to invoke the pupeteer's install script with the disable download env variable removed as part of mocha setup. Take a look at the approach here: https://github.com/WordPress/gutenberg/pull/25112

re-running yarn install in the project root and in the tests/e2e/ folders

I don't believe where you run yarn (install) is relevant.

Thanks @sirreal for looking into this. I suggest we document the workaround better till we test / deploy the automated fix? I suppose there will be more devs running into this problem sooner or later!

Thank you @sirreal for the quick reply!

I'm fine with keeping the suggestion as it is in calypso-doctor, but I agree with @cpapazoglou — we should document it better and start working/testing on the automated solution

Where's the best place for documenting the workaround? After a quick look, https://github.com/Automattic/wp-calypso/blob/master/test/e2e/README.md and/or https://github.com/Automattic/wp-calypso/blob/master/docs/troubleshooting.md seem a good fit.

Should we add any mention of this in the field guide too?

Where's the best place for documenting the workaround? After a quick look, https://github.com/Automattic/wp-calypso/blob/master/test/e2e/README.md

I haven't looked myself, but that seems like a good place to me. I'd encourage you to go the extra mile to implement the better fix if you can make it happen 🙂

Note there are at least two similar variables that may trigger this: PUPPETEER_SKIP_DOWNLOAD and PUPPETEER_SKIP_CHROMIUM_DOWNLOAD.

Should we add any mention of this in the field guide too?

Public is better than private and the documentation right in the package seems best to me.

@bsessions85 FYI.

Opened a first quick PR to document the workaround (#45573).

I'll have a look at implementing a better fix to the issue once I'll have some time 🙂

Was this page helpful?
0 / 5 - 0 ratings