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

Fix system tests #439

Merged
merged 4 commits into from
May 21, 2024
Merged

Fix system tests #439

merged 4 commits into from
May 21, 2024

Conversation

nymous
Copy link
Member

@nymous nymous commented May 20, 2024

The system tests were failing both locally and in CI, with this error (newlines added for readability):

/home/runner/work/lea5/lea5/vendor/bundle/ruby/3.1.0/gems/webdrivers-5.2.0/lib/webdrivers/chromedriver.rb:83:in `rescue in latest_point_release':
Unable to find latest point release version for 125.0.6422. 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.html (Webdrivers::VersionError)

This was caused by changed in Google hosting and API changes, which were not picked up by the webdrivers gem 1. This gem's functionality has now been included in selenium-webdriver, so updating it and removing webdrivers fixes this issue.
However we then hit another issue: ArgumentError: wrong number of arguments (given 2, expected 0..1), caused by a change in selenium-webdriver which broke capybara 2. It was fixed in 3.39.1.
We had then another error: unknown keyword: :capabilities 3. This was fixed in Rails actionpack 7.0.5.

This PR removes webdrivers from the Gemfile, updates selenium-webdriver and capybara to the latest version, and updates Rails to the latest 7.0.x (staying on the same minor version to have the least amount of changes).
This was done by updating the Gemfile manually, then running bundle update rails selenium-webdrivers capybara.

Finally, the fix on the CI workflow should have been caught in #436 but tests were failing then, so it's fixed here (the codecov action needs an Actions Workflow permission to generate a GitHub OIDC token).

Footnotes

  1. https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641139415

  2. https://github.com/teamcapybara/capybara/issues/2666

  3. https://github.com/rails/rails/releases/tag/v7.0.5

@nymous nymous changed the title wip: upgrade selenium-webdriver, capybara & rails, remove webdrivers Fix system tests May 21, 2024
Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a6aaf04) to head (71f5f55).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #439   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          331       331           
  Branches        33        33           
=========================================
  Hits           331       331           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nymous nymous marked this pull request as ready for review May 21, 2024 18:46
Copy link
Member

@D0gmaDev D0gmaDev left a comment

Choose a reason for hiding this comment

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

🚀

@nymous nymous merged commit b9ccfb2 into master May 21, 2024
7 checks passed
@nymous nymous deleted the fix-system-tests branch May 21, 2024 23:06
@nymous nymous mentioned this pull request May 28, 2024
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants