-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] update how python tests are filtered and run on github #16814
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
base: trunk
Are you sure you want to change the base?
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||||||||||||||
PR Code Suggestions ✨Latest suggestions up to 6f7fd0d
Previous suggestionsSuggestions up to commit 84bc272
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors how Python tests are filtered and executed in GitHub Actions CI to improve efficiency and granularity of test runs.
Key Changes:
- Transforms "remote" from a driver type to a command-line flag (
--remote), allowing any browser to run tests against a Selenium Grid - Enhances
check-bazel-targets.shto intelligently filter test targets based on changed files, enabling targeted test execution - Modifies CI workflows to conditionally run full test suites (docs, typing, unit tests) only when explicitly requested or when
[py]tag is present, while always running affected browser tests
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/github-actions/check-bazel-targets.sh |
Improved Bazel target detection with better error handling and filtering logic for test targets across bindings |
py/conftest.py |
Removed "remote" as a driver type and added --remote flag; updated fixtures to support running any browser remotely |
py/BUILD.bazel |
Refactored remote test targets to generate separate test-<browser>-remote targets for chrome and firefox instead of a single generic remote target |
.github/workflows/ci.yml |
Added targets and run-full-suite parameters to the Python workflow call for conditional test execution |
.github/workflows/ci-python.yml |
Added input handling, target filtering job, and updated browser test matrix to use tag-based filtering with targeted test execution |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
10afc7c to
6f7fd0d
Compare
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
User description
🔗 Related Issues
Python implementation of #16809
We are mostly relying on RBE to tell us if there is a problem, this is supposed to be extra information that strikes a good balance between information and execution time.
💥 What does this PR do?
First, I made it so that remote isn't tied to one browser. Bazel supports chrome and firefox, but this is quickly adjustable
ci.ymlkicks off on every commit. It runs the new and improvedcheck-bazel-targets.shInstead of just checking to see if there are any
pytargets and running the whole ci-python workflow, the unique set of applicable test targets are passed from the script toci-python.ymland browser tests are only run on thoseAdditionally, docs/steep/unit tests are only run if the PR includes "[py]" or is executed manually (passed into
ci-python.ymlfromci.ymlwith arun-full-suiteargument.Even if tagged
[py], if only a subset of python tests are matched, only those will be runRemoved build instead of gating all tests on it. Most of the build is executed by the applicable tests as necessary. If there is something weird that breaks building, it'll get detected in nightly run
As far as browser tests changed, it removes the edge tests for now for consistency with other bindings
💡 Additional Considerations
We may want to filter this further, and I'd like to add testing on beta versions of chrome/firefox
Is there a reason why the remote tests are running on Windows and not in RBE? Can we remove
skip-rbeand try to run more things in RBE?PR Type
Enhancement, Tests
Description
Decouple remote testing from specific browser driver
Filter Python tests by affected files in CI workflow
Conditionally run docs/typing/unit tests on [py] tag
Generate separate remote test targets for Chrome and Firefox
Remove build job dependency from test execution
Diagram Walkthrough
File Walkthrough
conftest.py
Decouple remote testing from driver classpy/conftest.py
remotefrom static drivers list and added--remotecommand-line option
is_remoteproperty
_initialize_driver()to usewebdriver.Remote()when--remoteflag is set
firefox_optionsandchromium_optionstocheck
--remoteflag instead of driver classSupportedBidiDrivers.remoteentrycheck-bazel-targets.sh
Improve target filtering with universe limitsscripts/github-actions/check-bazel-targets.sh
set -euo pipefailBINDINGS_UNIVERSEvariable
ci-python.yml
Refactor CI workflow with conditional test execution.github/workflows/ci-python.yml
targetsandrun-full-suiteparametersrun-full-suiteinputfilter-targetsjob to filter targets for Pythontest-remotewithtest-chrome-remoteandtest-firefox-remotetargets
[chrome, firefox, chrome-bidi, edge]to[chrome, firefox, chrome-bidi, chrome-remote]targets
ci.yml
Add target filtering to Python workflow trigger.github/workflows/ci.yml
targetsandrun-full-suiteoutputs from check job to Pythonworkflow
run-full-suiteto true only for scheduled runs, manual dispatch,or
[py]tag in PR title[py]tagBUILD.bazel
Generate per-browser remote test targetspy/BUILD.bazel
test-remotetarget with generated targets for Chromeand Firefox
--remoteflag to test arguments instead of--driver=remotetargets
chrome-remoteandfirefox-remotefor test selection