fix(ci-trigger): resume the regular line behind the green window, not the deployed one

The offset a retrigger carries skipped every row the source run merely
started. A row that failed or was cancelled therefore retired its place in
the ranking: the regular line resumed past it, and the row came back only on
the priority line, pinned to the one combination it was recorded in. Every
other combination of that row was silently dropped from the sweep.

resume_offset now stops at the first row that is not green, so only proven
coverage is skipped. passed_selections supplies it; the three token
comprehensions that only differed in their state filter collapse into one
helper. deployed_selections and settled_selections keep feeding
--include-unrun unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5 committed 2026-08-31 16:25:51 +02:00
1 parent 8434d35d82
commit bfde5876ba
4 files changed
+80 -47

No files matched your search

@@ -41,43 +41,48 @@ class TestResumeOffset(unittest.TestCase):
self.assertEqual(selections.resume_offset(self._REGULAR, set()), "")
def test_the_offset_is_the_last_row_of_the_leading_run(self) -> None:
deployed = {
passed = {
"web-app-a#0@compose+clearnet" + _AXES,
"web-app-b#1@swarm+tor" + _AXES,
}
self.assertEqual(selections.resume_offset(self._REGULAR, passed), "web-app-b#1")
def test_a_red_row_stops_the_scan_so_the_line_walks_it_again(self) -> None:
jobs = [
_job(deploy_job_name("docker", "web-app-a", "0"), "success"),
_job(deploy_job_name("swarm", "web-app-b", "1", tor=True), "failure"),
_job(deploy_job_name("host", "web-app-c", "0"), "success"),
]
self.assertEqual(
selections.resume_offset(self._REGULAR, deployed), "web-app-b#1"
selections.resume_offset(self._REGULAR, selections.passed_selections(jobs)),
"web-app-a#0",
)
def test_the_offset_carries_no_axes_so_it_survives_a_new_sweep(self) -> None:
"""Every axis rotates with the sweep number and a retrigger gets a
fresh one, so an axis-pinned offset would resolve only in the sweep it
was computed at and abort every chunk's discovery in the others."""
deployed = {"web-app-a#0@compose+clearnet" + _AXES}
offset = selections.resume_offset(self._REGULAR, deployed)
passed = {"web-app-a#0@compose+clearnet" + _AXES}
offset = selections.resume_offset(self._REGULAR, passed)
self.assertNotIn("@", offset)
self.assertNotIn("+", offset)
self.assertNotIn("%", offset)
self.assertNotIn("/", offset)
def test_a_gap_stops_the_scan_rather_than_skipping_past_it(self) -> None:
deployed = {
passed = {
"web-app-a#0@compose+clearnet" + _AXES,
"web-app-c#0@host+clearnet" + _AXES,
}
self.assertEqual(
selections.resume_offset(self._REGULAR, deployed), "web-app-a#0"
)
self.assertEqual(selections.resume_offset(self._REGULAR, passed), "web-app-a#0")
def test_a_run_that_covered_everything_resumes_at_the_last_row(self) -> None:
deployed = {
passed = {
"web-app-a#0@compose+clearnet" + _AXES,
"web-app-b#1@swarm+tor" + _AXES,
"web-app-c#0@host+clearnet" + _AXES,
}
self.assertEqual(
selections.resume_offset(self._REGULAR, deployed), "web-app-c#0"
)
self.assertEqual(selections.resume_offset(self._REGULAR, passed), "web-app-c#0")
def test_the_verdict_does_not_matter_only_that_the_row_ran(self) -> None:
jobs = [
@@ -161,6 +166,22 @@ class TestSettledSelections(unittest.TestCase):
)
class TestPassedSelections(unittest.TestCase):
"""Only a green row lets the regular line walk past it."""
def test_only_the_successes_are_kept(self) -> None:
jobs = [
_job(deploy_job_name("docker", "web-app-a", "0"), "success"),
_job(deploy_job_name("swarm", "web-app-b", "1", tor=True), "failure"),
_job(deploy_job_name("host", "web-app-c", "0"), "cancelled"),
]
self.assertEqual(
selections.passed_selections(jobs),
{"web-app-a#0@compose+clearnet" + _AXES},
)
self.assertEqual(len(selections.settled_selections(jobs)), 2)
class TestCollapseToRoles(unittest.TestCase):
"""Trading the exact red combination for covering the role."""