theintern / intern

A next-generation code testing stack for JavaScript.
https://theintern.io/
Other
4.36k stars 311 forks source link

Allow easy use of GitHub Action's CHROMEWEBDRIVER environment variable #1159

Open jason0x43 opened 4 years ago

jason0x43 commented 4 years ago

GitHub Actions virtual environments (linux and windows) expose a CHROMEWEBDRIVER environment variable that points to the local chromedriver.exe. Intern should be able to use this information to allow use of the existing webdriver vs downloading a new one.

This could be accomplished in a couple of ways:

  1. Update SeleniumTunnel to understand CHROMEWEBDRIVER (and FIREFOXWEBDRIVER, etc) env vars
  2. Update the config processing code to understand env vars (which would be more generally useful). This would also require updating dig dug to allow executables to be specified for drivers.
dstaley commented 4 years ago

It looks like the environment variable ChromeWebDriver points to the folder where the webdriver is installed. So determining the version would include executing the chromedriver contained within the folder and parsing out the version string.

> chromedriver --version
ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416})

As an alternative, you could also just execute chromedriver --version directly since it's already in the PATH.

jason0x43 commented 4 years ago

That's a good idea; Intern could check for the existence of a webdriver in the path before deciding to download one, or we could use a dedicated version string like "local" to tell Intern to assume a driver is in the path.