internal(pytest-mergify): honour an empty and a refused test selection - #140
Open
Conversation
Merge Protections🔴 2 of 6 protections blocking · waiting on 👀 reviews
🔴 👀 Review RequirementsWaiting for
This rule is failing.
🔴 🔎 ReviewsWaiting for
This rule is failing.
Show 4 satisfied protections🟢 🤖 Continuous Integration
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
AlexandreGaubert
force-pushed
the
devs/alexandregaubert/devs/alexandregaubert/pytest-empty-and-refused-selection/honour-empty-refused-test-selection--f86da8d1
branch
from
September 1, 2026 15:49
cadc7ca to
2d73fdd
Compare
Contributor
Author
Revision history
|
AlexandreGaubert
force-pushed
the
devs/alexandregaubert/devs/alexandregaubert/pytest-empty-and-refused-selection/honour-empty-refused-test-selection--f86da8d1
branch
from
September 1, 2026 15:59
2d73fdd to
739f042
Compare
The engine is gaining two answers on the test-selection endpoint that no published client knows: `empty` -- the predecessor's attempt of this job already ran these tests and they passed, so run none of them -- and `refused` -- several sessions share this job's name and collected the same tests, so Mergify will not guess which one this run succeeds. Both fall through the plugin's forward-compatibility guard today and quietly run the full suite, which would make the feature's most visible outcome never happen, and would leave an ambiguous job answered wrongly forever with no symptom to notice. Teach the plugin both. An `empty` answer empties the collection through pytest's own deselection hook, so the session still finishes and still uploads -- a job that legitimately ran nothing is the one a developer comes asking about, and a shorter exit during collection would make it the only one missing from Mergify's reporting -- and the run exits 0 instead of pytest's "no tests ran" code 5. A `refused` answer raises `pytest.UsageError`, showing the server's own explanation of what it saw and what to change -- the copy belongs there so it can be corrected without publishing a client -- and marks the uploaded session errored so it cannot be read as a clean empty one. Every other value keeps degrading to a full run, which is what lets the engine grow answers without breaking clients already published; the crate-level test pinning that now uses a variant nothing implements, `empty` having stopped being one. pytest only. Vitest and Playwright share the Rust decoder but normalise in their own TypeScript and have test selection disabled for the pilot (MRGFY-8906), so wiring them now would be work on a path nobody runs. They keep degrading to a full run on both answers, deliberately. Fixes MRGFY-8931 Change-Id: If86da8d1092f9aff8643cddfa2f6f99d90873b69
AlexandreGaubert
force-pushed
the
devs/alexandregaubert/devs/alexandregaubert/pytest-empty-and-refused-selection/honour-empty-refused-test-selection--f86da8d1
branch
from
September 2, 2026 07:05
739f042 to
d7e6522
Compare
AlexandreGaubert
marked this pull request as ready for review
September 2, 2026 08:23
sileht
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The engine is gaining two answers on the test-selection endpoint that no
published client knows:
empty-- the predecessor's attempt of this jobalready ran these tests and they passed, so run none of them -- and
refused-- several sessions share this job's name and collected thesame tests, so Mergify will not guess which one this run succeeds. Both
fall through the plugin's forward-compatibility guard today and quietly
run the full suite, which would make the feature's most visible outcome
never happen, and would leave an ambiguous job answered wrongly forever
with no symptom to notice.
Teach the plugin both. An
emptyanswer empties the collection throughpytest's own deselection hook, so the session still finishes and still
uploads -- a job that legitimately ran nothing is the one a developer
comes asking about, and a shorter exit during collection would make it
the only one missing from Mergify's reporting -- and the run exits 0
instead of pytest's "no tests ran" code 5. A
refusedanswer raisespytest.UsageError, showing the server's own explanation of what it saw andwhat to change -- the copy belongs there so it can be corrected without
publishing a client -- and marks the uploaded session errored so it cannot be
read as a clean empty one. Every other value
keeps degrading to a full run, which is what lets the engine grow
answers without breaking clients already published; the crate-level test
pinning that now uses a variant nothing implements,
emptyhavingstopped being one.
pytest only. Vitest and Playwright share the Rust decoder but normalise
in their own TypeScript and have test selection disabled for the pilot
(MRGFY-8906), so wiring them now would be work on a path nobody runs.
They keep degrading to a full run on both answers, deliberately.
Fixes MRGFY-8931