[build] use pinned browser and driver for starting grid in python and ruby tests#17610
Conversation
Review Summary by QodoPin browser and driver binaries for remote Grid tests
WalkthroughsDescription• Pins browser and driver binaries for remote Grid tests to avoid Selenium Manager downloads • Reduces disk space usage by reusing cached binaries across test runs • Adds configurable args parameter to Server class for custom Grid configuration • Implements stereotype-based driver configuration for both Python and Ruby test environments Diagramflowchart LR
A["Test Config<br/>--driver-binary<br/>--browser-binary"] -->|Python conftest| B["_pinned_grid_args()"]
A -->|Ruby test_environment| C["driver_configuration()"]
B -->|Creates stereotype| D["Server args"]
C -->|Creates stereotype| D
D -->|Passes to Grid| E["Grid Node<br/>Skips Selenium Manager"]
F["Selenium Manager<br/>Default behavior"] -->|When no binaries| D
File Changes1. py/conftest.py
|
Code Review by Qodo
1. Empty cache path uses CWD
|
There was a problem hiding this comment.
Pull request overview
This PR updates the Ruby and Python Grid test harnesses to prefer pinned browser/driver binaries (when provided) by passing an explicit Grid --driver-configuration stereotype, avoiding repeated Selenium Manager downloads that can exhaust disk space in CI.
Changes:
- Ruby remote Grid startup now builds a
--driver-configurationfrom pinned*_BINARYenv vars (and only uses Selenium Manager when not pinned). - Python
Servergains an additiveargsparameter (defaulting to Selenium Manager + managed downloads), andpy/conftest.pyoverrides args when--driver-binary/--browser-binaryare provided. - Java Grid node flag documentation corrects the example key to
webdriver-executable.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb | Builds Grid startup args/driver-configuration to use pinned driver/browser paths where available. |
| py/selenium/webdriver/remote/server.py | Adds args parameter to control standalone server CLI flags while preserving existing defaults. |
| py/conftest.py | Detects pinned binaries from pytest options and passes a matching Grid driver configuration stereotype. |
| java/src/org/openqa/selenium/grid/node/config/NodeFlags.java | Fixes the documented driver-configuration example key to webdriver-executable. |
ff9acf9 to
320bb44
Compare
|
Code review by qodo was updated up to the latest commit 320bb44 |
320bb44 to
c1d2926
Compare
|
Code review by qodo was updated up to the latest commit c1d2926 |
|
Code review by qodo was updated up to the latest commit 1c0b3c9 |
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
Several long-running tests on GitHub actions are running out of disk space because #17602 deleted the installed browsers.
The expectation is that either browsers are pinned, or selenium manager caches the binaries on HOME.
Except there are 3 issues with this
TL/DR: each test was downloading all the browsers and leaving them there.
💥 What does this PR do?
For both Ruby & Python
🔧 Implementation Notes
Servergains an additiveargsparam (defaulting to the Selenium Manager and Download Enabled flags to maintain backwards compatibility);conftest.pyoverrides it from--driver-binary/--browser-binarywhen pinned.test_environment.rbbuilds the same configuration from the pinned*_BINARYenv vars.Additional Considerations
test --run_under=//scripts:test_tmp_cleanupsince we don't get that behavior like we would if we were running in the bazel sandbox, but I'm not sure we need belt, suspenders and duct tape for this.🤖 AI assistance
🔄 Types of changes