all discovery integration tests are falling for me with Selenium::WebDriver::Error::SessionNotCreatedError: session not created: Chrome version must be between 71 and 75 (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 5.2.16-200.fc30.x86_64 x86_64)
Now with help of @ezr-ondrej we’ve found that updating chromedriver to the version that matches my Google Chrome (which is currently the stable - 77) does help, however this leaves a lock file in changed state in git:
Is there a way to override values in package.json? Can we implement such thing so people can freely override it just like we do this for Ruby bundler?
What is our update strategy for this dependency? Is it pinned because of particular Chrome version on our CI infra? Or is there a different reason? If not let’s remove the pin and install latest stable version which will most likely match for the most people and pin it manually on CI.
But this will still update the package.json to version you define, right?
We do not want to force people to use one version of chrome as it shouldn’t matter, right?
I would like to come up with a solution which would enable decent freedom in chrome version.
There is a official way how to get the right chrome-driver:
No, the version installed by npm doesn’t contain the actual driver but some code that can handle downloading the driver.
Once you define the env var and run npm install, it will use a postinstall that will download the driver based on your env var (or from cache, or latest).
You will still need to know what version of the driver to download. The npm package contain the code that allow you to use download the version you need.
Can’t we use the latest stable version of the wrapper and let the native system packages handle the actual chromedriver package? On Fedora they ensure it’s in sync with chromium so you don’t have to worry about it. At least for the average developer on Fedora that sounds like a much more stable and secure solution.
So it looks like the Fedora package chromedriver actually uses chromium-headless to do the job. Nice, let me try this:
$ sudo dnf install chromedriver
$ rm -rf node_modules/
$ npm install
Done. ChromeDriver binary available at /home/lzap/work/foreman/node_modules/chromedriver/lib/chromedriver/chromedriver
> node-sass@4.12.0 install /home/lzap/work/foreman/node_modules/node-sass
> node scripts/install.js
Cached binary found at /home/lzap/.npm/node-sass/4.12.0/linux-x64-64_binding.node
As you can see, unfortunately it is not picking it up. We should make it so it always prefer chromedriver from the OS which will be more likely to be on par with the browser version. How to do that?
If you export CHROMEDRIVER_SKIP_DOWNLOAD=true or add chromedriver_skip_download=true to ~/.npmrc, does it skip downloading and automatically pick up the system wide version?
@infra - Was there a recent update on jenkins workers that installed a new chromium? @ui_ux - what should be done to make sure we are always running with a compatible version?
We need to figure out how to fix this properly as it is currently blocking PR testing.
I opened a pr to upgrade the version of chrome driver and hopefully get tests running again, but we should fix this properly in a way that doesn’t break next time a new chromium version is released: https://github.com/theforeman/foreman/pull/7099