[py] run affected python tests per-browser on PR, full suite on schedule - #17643
Conversation
Review Summary by Qodo(Agentic_describe updated until commit 79bfb73)Run affected Python tests per-browser on PR, full suite on schedule
WalkthroughsDescription• Run only affected Python tests per-browser on PR, full suite on schedule • Pass target list from main CI workflow to Python workflow via inputs • Update rerun-failures script to handle bazel query results • Remove build job dependency for test jobs, keep only on schedule/manual • Use bazel query intersection to filter tests by affected targets Diagramflowchart LR
CI["ci.yml<br/>Read Targets"] -->|"py_targets"| PY["ci-python.yml<br/>Receive targets input"]
PY -->|"Schedule/Manual"| BUILD["Build Job"]
PY -->|"PR: affected only"| REMOTE["Remote Tests<br/>bazel query intersect"]
PY -->|"PR: affected only"| BROWSER["Browser Tests<br/>bazel query intersect"]
RERUN["rerun-failures.sh<br/>Parse query results"] -.->|"Enhanced"| REMOTE
RERUN -.->|"Enhanced"| BROWSER
File Changes1. scripts/github-actions/rerun-failures.sh
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
11 rules 1.
|
|
Code review by qodo was updated up to the latest commit decdc1c |
decdc1c to
eb7cf50
Compare
|
Code review by qodo was updated up to the latest commit eb7cf50 |
eb7cf50 to
b9fdf97
Compare
|
Code review by qodo was updated up to the latest commit b9fdf97 |
There was a problem hiding this comment.
Pull request overview
This PR updates Selenium’s GitHub Actions CI wiring for the Python binding to reduce per-PR runtime by running only the Bazel test targets affected by the PR (while keeping broader coverage on scheduled/manual runs). It also extends the shared rerun helper to support workflows that compute target lists via trailing $(bazel query ...) substitutions.
Changes:
- Pass the affected
//pytarget list fromci.ymlinto the reusableci-python.ymlworkflow and gate PR execution on that list being non-empty. - Move Python build + unit-test matrix to scheduled/manual runs; run integration suites on PRs using Bazel query intersections against the affected target set.
- Update
rerun-failures.shto strip trailing$(...)query expressions when reconstructing the base rerun command.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/github-actions/rerun-failures.sh | Teach rerun logic to strip trailing $(...) query fragments when extracting the base command. |
| .github/workflows/ci.yml | Emit and forward py_targets from the affected-targets computation into the Python reusable workflow. |
| .github/workflows/ci-python.yml | Add targets workflow input and use Bazel query intersections to run only affected Python integration/browser targets on PRs; move build/unit matrix to schedule/manual. |
🔗 Related Issues
Part of #17539 to minimize low signal tests and duplication with RBE.
💥 What does this PR do?
Makes the Python GitHub Actions workflow run only the tests a PR or Push actually affects,
instead of the full suite on every PR. Continues to run existing tests on schedule/manual kickoff
ci.ymlnow passes the affected//pytarget list intoci-python.ymlto run only those targets for PRs and Pulls.[py]is specified in PR message or commit🔧 Implementation Notes
rerun-failures.shis shared infra (all bindings). The change is additive andbackward-compatible — it only affects run commands with a trailing
$(...), which no otherbinding uses today.
rerun-failures.shupdated to support analyzing query results🤖 AI assistance
ci.yml/ci-python.ymlworkflow changes and thererun-failures.shedit, iterated against repeated review.💡 Additional Considerations
bazel queryintersect to--test_tag_filtersafter implementing the necessary tags🔄 Types of changes