Skip to content
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

Chrome and Chromedriver versions mismatch #619

Open
alvincrespo opened this issue Jan 19, 2025 · 1 comment
Open

Chrome and Chromedriver versions mismatch #619

alvincrespo opened this issue Jan 19, 2025 · 1 comment

Comments

@alvincrespo
Copy link

I'm using standard rails tests and running into this issue:

Run bundle exec rails test
Rebuilding...
Done in 1626ms.
2025-01-[19](https://github.com/jardim-io/backend/actions/runs/12857703745/job/35845877630?pr=2132#step:16:20) 22:42:26 INFO Selenium [:logger_info] Details on how to use and modify Selenium logger:
  https://selenium.dev/documentation/webdriver/troubleshooting/logging
2025-01-19 [22](https://github.com/jardim-io/backend/actions/runs/12857703745/job/35845877630?pr=2132#step:16:23):42:26 WARN Selenium [:selenium_manager] The chromedriver version (132.0.6834.83) detected in PATH at /opt/hostedtoolcache/setup-chrome/chromedriver/stable/x64/chromedriver might not be compatible with the detected chrome version (131.0.6778.204); currently, chromedriver 131.0.6778.264 is recommended for chrome 131.*, so it is advised to delete the driver in PATH and retry 
Run options: --seed 41282
# Running:
.........E
Error:
AttachmentFormComponentTest#test_form_happy_path:
Selenium::WebDriver::Error::SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 132
Current browser version is 1[31](https://github.com/jardim-io/backend/actions/runs/12857703745/job/35845877630?pr=2132#step:16:32).0.6778.204 with binary path /usr/bin/google-chrome
    test/components/attachment_form_component_test.rb:5:in `test_form_happy_path'

It turns out that browser-actions/setup-chrome installs the correct chrome and chromedriver versions but for whatever reason google-chrome isn't returning the version installed by this action.

ci.yml

- name: Install Chrome
      uses: browser-actions/setup-chrome@v1
      with:
        chrome-version: stable
        install-chromedriver: true

- name: Output Chrome Info
  run: |
    google-chrome --version
    chromedriver --version

Logs

Install Chrome

Run browser-actions/setup-chrome@v1
Setup chrome stable
Attempting to download chrome stable...
Acquiring chrome stable from https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
Installing chrome...
/usr/bin/ar x /home/runner/work/_temp/91af369b-d5bf-4ca9-a8a1-182b1e7efd7b
/usr/bin/tar -xf /tmp/deb-JX6jT3/data.tar.xz --directory /tmp/chrome-JqWEPB --strip-components 4 ./opt/google
Successfully Installed chromium to /opt/hostedtoolcache/setup-chrome/chromium/stable/x64
/opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome --version
[0119/224118.629601:WARNING:chrome_main_linux.cc(80)] Read channel stable from /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/CHROME_VERSION_EXTRA
Google Chrome 132.0.6834.83 
Successfully setup chromium 132.0.6834.83
Setup chromedriver stable
Attempting to download chromedriver stable...
Acquiring chromedriver stable from https://storage.googleapis.com/chrome-for-testing-public/132.0.6834.83/linux64/chromedriver-linux64.zip
Installing chromedriver...
/usr/bin/unzip -o -q /home/runner/work/_temp/[21](https://github.com/jardim-io/backend/actions/runs/12857703745/job/35845877630?pr=2132#step:5:22)b80ca1-b375-46f3-b06f-8798b9f0b59c
Successfully Installed chromedriver to /opt/hostedtoolcache/setup-chrome/chromedriver/stable/x64
/opt/hostedtoolcache/setup-chrome/chromedriver/stable/x64/chromedriver --version
ChromeDriver 132.0.6834.83 (03d59cf5ecf1d8444838ff9a1e96[23](https://github.com/jardim-io/backend/actions/runs/12857703745/job/35845877630?pr=2132#step:5:24)1304d4ff9c-refs/branch-heads/6834@{#3390})
Successfully setup chromedriver 132.0.6834.83

Output Chrome Info

Run google-chrome --version
Google Chrome 131.0.6778.204 
ChromeDriver 132.0.6834.83 (03d59cf5ecf1d8444838ff9a1e96231304d4ff9c-refs/branch-heads/6834@{#3390})
@alvincrespo alvincrespo changed the title Chrome and Chromedriver verisons mismatch Chrome and Chromedriver versions mismatch Jan 19, 2025
@alvincrespo
Copy link
Author

alvincrespo commented Jan 19, 2025

Ah looks like I was using the system version.

I added a step to update the google-chrome path:

      - name: Update PATH
        run: |
          sudo ln -sf /opt/hostedtoolcache/setup-chrome/chromium/stable/x64/chrome /usr/bin/google-chrome

I'm not sure why https://github.com/browser-actions/setup-chrome/blob/master/src/channel_linux.ts#L86 removes the symlink tbh.

Maybe we should add an optional flag that updates the default google-chrome path?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant