Kill the mutants that survived the stability round's fixes
CI / tests (pull_request) Successful in 3m27s
CI / tests (pull_request) Successful in 3m27s
This commit is contained in:
@@ -163,17 +163,17 @@ class Levelled(unittest.TestCase):
|
||||
self.assertEqual(levelled("ABC-1", "origin/main", run=scripted(calls, fetch=LOCKED)), LOCKED)
|
||||
self.assertEqual([args[0] for args in calls], ["fetch", "fetch"])
|
||||
|
||||
def test_every_call_to_origin_stops_after_the_timeout_given(self) -> None:
|
||||
for answers, origin_calls in (({"ls_remote": ""}, ["fetch", "ls-remote", "push", "fetch"]), ({"push": Failure("git push: rejected")}, ["fetch", "ls-remote", "push", "fetch", "ls-remote", "push"])):
|
||||
def test_every_call_to_origin_runs_in_the_checkout_and_stops_after_the_timeout_given(self) -> None:
|
||||
for answers, origin_calls in (({"ls_remote": ""}, ["fetch", "ls-remote", "push", "fetch"]), ({"push": Failure("git push: rejected")}, ["fetch", "ls-remote", "push", "fetch", "ls-remote", "push"]), ({"fetch": [LOCKED, ""], "ls_remote": ""}, ["fetch", "fetch", "ls-remote", "push", "fetch"]), ({"fetch": ["", LOCKED, ""], "ls_remote": ""}, ["fetch", "ls-remote", "push", "fetch", "fetch"])):
|
||||
with self.subTest(origin_calls=origin_calls):
|
||||
timed: list[tuple[str, float | None]] = []
|
||||
timed: list[tuple[str, float | None, str | None]] = []
|
||||
answering = scripted([], **answers)
|
||||
|
||||
def run(*args: str, cwd: str | None = None, timeout: float | None = None, guarded: bool = False, errors: str = "strict") -> str | Failure:
|
||||
timed.append((args[0], timeout))
|
||||
timed.append((args[0], timeout, cwd))
|
||||
return answering(*args, cwd=cwd, timeout=timeout, guarded=guarded, errors=errors)
|
||||
levelled("ABC-1", "origin/main", timeout=5, run=run)
|
||||
self.assertEqual([(name, timeout) for name, timeout in timed if name in ("fetch", "ls-remote", "push")], [(name, 5) for name in origin_calls])
|
||||
levelled("ABC-1", "origin/main", cwd="/checkout", timeout=5, run=run)
|
||||
self.assertEqual([call for call in timed if call[0] in ("fetch", "ls-remote", "push")], [(name, 5, "/checkout") for name in origin_calls])
|
||||
|
||||
|
||||
class ChunkBase(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user