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

Stop using webdrivers gem #43

Merged
merged 2 commits into from
Mar 7, 2022
Merged

Stop using webdrivers gem #43

merged 2 commits into from
Mar 7, 2022

Conversation

ollietreend
Copy link
Contributor

@ollietreend ollietreend commented Feb 25, 2022

We've traditionally used the gem webdrivers to automagically install ChromeDriver on the system at runtime, so that it's available for use by Capybara and headless Jasmine tests.

However this approach is beginning to cause us some problems because Google Chrome and ChromeDriver aren't currently available as Linux ARM binaries. This means that developers on Apple M1 MacBooks are unable to run tests when working in the govuk-docker development environment.

We've therefore made the decision to change how we install and use Chrome and its associated WebDriver. Instead of applications being responsible for installing ChromeDriver via this gem's use of webdrivers, we've made it the responsibility of the underlying operating system to provide a compatible browser and WebDriver.

In everyday use, this change should be unnoticeable because we've prepared our tooling ahead of time:

However, if you're running tests in another environment (e.g. local development on bare metal), you'll need to make sure ChromeDriver is available. This is usually as simple as running:

$ brew install chromedriver

CHANGELOG.md Outdated Show resolved Hide resolved
kevindew added a commit to alphagov/govuk_publishing_components that referenced this pull request Feb 28, 2022
In the time since PR 2625 [1] was merged we've learnt that the webdrivers
gem is going to cause a problem for the GOV.UK development environment,
govuk-docker, when running on M1 macs.

We have decided to change tact and focus on installing a chromedriver on
the underlying machine rather than using webdrivers as a source of this
software [2] [3]. This seems extra pragmatic now that we have Javascript
dependencies also using chromedriver.

A step towards this is removing this intertwining of Ruby webdriver
dependency from this repo's yarn tests.

The effect merging this will have is:

- The build will continue to pass in GitHub Actions CI - chromedriver is
  installed
- Users running jasmine tests in govuk-docker will need to be using [2]
- Users running jasmine tests on their local machine will have to
  install chromedriver manually (there is a helpful prompt)

[1]: #2625
[2]: alphagov/govuk-docker#577
[3]: alphagov/govuk_test#43
We've traditionally used the gem [`webdrivers`][webdrivers] to automagically install ChromeDriver on the system at runtime, so that it's available for use by Capybara and headless Jasmine tests.

However this approach is beginning to cause us some problems because Google Chrome and ChromeDriver aren't currently available as Linux ARM binaries. This means that developers on Apple M1 MacBooks are unable to run tests when working in the [govuk-docker] development environment.

We've therefore made the decision to change how we install and use Chrome and its associated WebDriver. Instead of applications being responsible for installing ChromeDriver via this gem's use of `webdrivers`, we've made it the responsibility of the underlying operating system to provide a compatible browser and WebDriver.

In everyday use, this change should be unnoticeable because we've prepared our tooling ahead of time:
- govuk-docker now comes with ChromeDriver (see alphagov/govuk-docker#577)
- Jasmine CI workers also have ChromeDriver (see alphagov/govuk-puppet#11568)
- The GitHub Actions `ubuntu-latest` image has ChromeDriver pre-installed (see [the docs][ubuntu-latest])

However, if you're running tests in another environment (e.g. local development on bare metal), you'll need to make sure ChromeDriver is available. This is usually as simple as running:

```
$ brew install chromedriver
```

[webdrivers]: https://rubygems.org/gems/webdrivers
[govuk-docker]: https://github.com/alphagov/govuk-docker
[ubuntu-latest]: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#browsers-and-drivers
@ollietreend ollietreend merged commit 60036e5 into main Mar 7, 2022
@ollietreend ollietreend deleted the drop-webdrivers-gem branch March 7, 2022 15:43
kevindew added a commit to alphagov/maslow that referenced this pull request Mar 7, 2022
This repo doesn't make any direct references to it and, as per
alphagov/govuk_test#43 GOV.UK is preferring
webdrivers to be installed on the OS rather than by Ruby.
kevindew added a commit to alphagov/travel-advice-publisher that referenced this pull request Mar 7, 2022
This repo doesn't make any direct references to it and, as per
alphagov/govuk_test#43 GOV.UK is preferring
webdrivers to be installed on the OS rather than by Ruby.
kevindew added a commit to alphagov/manuals-publisher that referenced this pull request Mar 7, 2022
This repo doesn't make any direct references to it and, as per
alphagov/govuk_test#43 GOV.UK is preferring
webdrivers to be installed on the OS rather than by Ruby.
kevindew added a commit to alphagov/transition that referenced this pull request Mar 8, 2022
This repo doesn't make any direct references to it and, as per
alphagov/govuk_test#43 GOV.UK is preferring
webdrivers to be installed on the OS rather than by Ruby.
kevindew added a commit to alphagov/publisher that referenced this pull request Mar 8, 2022
This repo doesn't make any direct references to it and, as per
alphagov/govuk_test#43 GOV.UK is preferring
webdrivers to be installed on the OS rather than by Ruby.
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

Successfully merging this pull request may close these issues.

2 participants