CircleCI-Public / browser-tools-orb

Quickly and easily install common browsers and browser testing tools on CircleCI
https://circleci.com/developer/orbs/orb/circleci/browser-tools
MIT License
24 stars 34 forks source link

install-chromedriver command puts 'chromedriver' binary at unexpected location for Chrome 115 #81

Closed frerich closed 1 year ago

frerich commented 1 year ago

Orb version

1.4.2

What happened

CI builds expecting that the install-chromedriver commands puts a binary at /usr/local/bin/chromedriver started failing. This only appeared with Chrome 115. These days, the binary appears to end up in /usr/local/bin/chromedriver/chromedriver.

Expected behavior

The chromedriver binary should always end up in the directory specified by the install-dir option. By default, this would be /usr/local/bin. Thus, after successful execution of the instal-chromedriver command, there should be a binary /usr/local/bin/chromedriver.

Further observations

It appears that the structure of chromedriver ZIP files changed slightly: with Chromedriver 114 I get

/tmp % curl -LO https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip && unzip -l chromedriver_linux64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7233k  100 7233k    0     0  5011k      0  0:00:01  0:00:01 --:--:-- 5030k
Archive:  chromedriver_linux64.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
 15039112  05-27-2023 02:10   chromedriver
   326542  05-27-2023 02:10   LICENSE.chromedriver
---------                     -------
 15365654                     2 files

but with chromedriver 115 there's an extra 'chromedriver' subdirectory:

/tmp % curl -LO https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.98/linux64/chromedriver-linux64.zip && unzip -l chromedriver-linux64.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7061k  100 7061k    0     0  6354k      0  0:00:01  0:00:01 --:--:-- 6390k
Archive:  chromedriver-linux64.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
   280041  07-15-2023 00:04   chromedriver-linux64/LICENSE.chromedriver
 13547232  07-15-2023 00:04   chromedriver-linux64/chromedriver
---------                     -------
 13827273                     2 files
brx-craig commented 1 year ago

Can confirm, this is current an issue for a large number of folks. https://googlechromelabs.github.io/chrome-for-testing/

Lance-Foley commented 1 year ago

Can I assume this address this error? None of the workarounds from the previous PR seem to work for me.

Installed version of Google Chrome is 115.0.5790.98 115.0.5790.98 will be installed mv: cannot move 'chromedriver' to '/usr/local/bin/chromedriver': File exists

twohlix commented 1 year ago

Yeah, Failing for us too - now instead of failing fast during chromedriver install it just fails later during the test runs with:

Webdrivers::VersionError:
              Unable to find latest point release version for 115.0.5790. You appear to be using a non-production version of Chrome. Please set `Webdrivers::Chromedriver.required_version = <desired driver version>` to a known chromedriver version: https://chromedriver.storage.googleapis.com/index.htm

or

Webdrivers::NetworkError:
            #   Net::HTTPServerException: 404 "Not Found" with https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790
            #   /home/circleci/project/bundle/ruby/3.1.0/gems/webdrivers-5.2.0/lib/webdrivers/network.rb:19:in `get'
ryanbourdais commented 1 year ago

Hi @frerich this should be fixed in the newly published orb version 1.4.3

frerich commented 1 year ago

I can confirm - version 1.4.3 works as expected. Thanks!