Skip to content

Use Latest Stable Chromedriver in CI#64444

Merged
Hamms merged 8 commits into
stagingfrom
elijah/chrome-for-testing-in-docker-ci
Mar 15, 2025
Merged

Use Latest Stable Chromedriver in CI#64444
Hamms merged 8 commits into
stagingfrom
elijah/chrome-for-testing-in-docker-ci

Conversation

@Hamms

@Hamms Hamms commented Mar 11, 2025

Copy link
Copy Markdown
Contributor

Google has deprecated the http://chromedriver.storage.googleapis.com installation endpoint in favor of the new https://googlechromelabs.github.io/chrome-for-testing/ approach. As such, although our CI image is using a relatively recent version of chrome, its version of chromedriver is quite out of date:

$ docker run --rm -it --entrypoint bash codedotorg/code-dot-org:1.14
ci@0b68e20ed657:~$ google-chrome --version
Google Chrome 131.0.6778.139
ci@0b68e20ed657:~$ chromedriver --version
ChromeDriver 114.0.5735.90 (386bc09e8f4f2e025eddae123f36f6263096ae49-refs/branch-heads/5735@{#1052})

In preparation for some ongoing work to run Selenium within Drone, we need Chrome and Chromedriver to be at similar versions. Which they now are:

$ docker run --rm -it --entrypoint bash codedotorg/code-dot-org:chrome-for-testing
ci@fac6d7f353aa:~$ google-chrome --version
Google Chrome 134.0.6998.35
ci@fac6d7f353aa:~$ chromedriver --version
ChromeDriver 134.0.6998.88 (7e3d5c978c6d3a6eda25692cfac7f893a2b20dd0-refs/branch-heads/6998@{#1898})

Note that we are still installing Chrome via https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb, which will not always be exactly up to date with the chrome-for-testing distribution. It is significantly more complicated to install manually than chromedriver is, unfortunately, so I left it as-is for now. The two dependencies should be kept significantly more in sync than previously, even if they won't be perfect.

Links

Testing story

Relying entirely on Drone CI to validate this Drone-CI-only change

Deployment strategy

BEFORE MERGING

Tag image with 1.15

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

Comment thread docker/ci/Dockerfile

#########################################################
FROM ubuntu:20.04 as base
FROM ubuntu:20.04 AS base

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting warnings on build:

 3 warnings found (use --debug to expand):
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 11)
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 53)
 - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 70)

Seemed easy enough to fix while I was in the area

@Hamms Hamms changed the title follow documented approach to install Chrome for Testing Use Latest Stable Chromedriver in CI Mar 14, 2025
Comment thread .drone.yml Outdated
# see: docker/ci/Dockerfile
# TODO: switch to codedotorg/cdo-ci
image: codedotorg/code-dot-org:1.14
image: codedotorg/code-dot-org:chrome-for-testing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upon approval, I'll retag this image as code-dot-org:1.15 and update and sign .drone.yml

@Hamms Hamms marked this pull request as ready for review March 14, 2025 21:13
@Hamms Hamms requested a review from a team as a code owner March 14, 2025 21:13
@Hamms Hamms requested a review from a team March 14, 2025 21:14
@Hamms Hamms added the testing label Mar 14, 2025
@Hamms Hamms merged commit acd174f into staging Mar 15, 2025
@Hamms Hamms deleted the elijah/chrome-for-testing-in-docker-ci branch March 15, 2025 01:56
Hamms added a commit that referenced this pull request May 6, 2026
* Sync Chrome and chromedriver in CI

Specifically, rather than installing the latest stable version of chromedriver we instead target a version that exactly matches the installed version of the chrome browser, which is likely to be slightly behind. Ideally we would be installing the latest stable version of the chrome browser, too, rather than relying on whatever's in the `.deb`, but as noted in #64444 that is a much more difficult proposition.

See thread [here](https://codedotorg.slack.com/archives/C0T0PNTM3/p1778091262918919) for more context

* target new image and re-sign drone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants