fix(run_tests_batched): detect batch failure from output when proc.returncode is wrong
This commit is contained in:
@@ -154,11 +154,14 @@ def _run_batch(b: Batch, durations: dict[str, float]) -> tuple[int, float, dict[
|
||||
proc.wait()
|
||||
elapsed = time.monotonic() - t0
|
||||
new_durs = _parse_durations_from_pytest_output("".join(captured))
|
||||
if proc.returncode == 0:
|
||||
captured_text = "".join(captured)
|
||||
saw_failure = "FAILED " in captured_text or " stopping after " in captured_text
|
||||
effective_code = proc.returncode if proc.returncode != 0 else (1 if saw_failure else 0)
|
||||
if effective_code == 0:
|
||||
print(_c(f"<<< {b.label} PASS in {elapsed:.1f}s", _C.BOLD_GREEN))
|
||||
else:
|
||||
print(_c(f"<<< {b.label} FAIL (exit {proc.returncode}) in {elapsed:.1f}s", _C.BOLD_RED))
|
||||
return proc.returncode, elapsed, new_durs
|
||||
print(_c(f"<<< {b.label} FAIL (exit {effective_code}) in {elapsed:.1f}s", _C.BOLD_RED))
|
||||
return effective_code, elapsed, new_durs
|
||||
|
||||
def _print_summary(results: list[tuple[Batch, int, float]]) -> int:
|
||||
print()
|
||||
|
||||
Reference in New Issue
Block a user