Build a list of TestFailureInfo objects from failed processes.
(
self,
exit_failed_processes: list[tuple[RunningProcess, int]],
failed_processes: list[str],
)
| 520 | ) |
| 521 | |
| 522 | def _build_failure_list( |
| 523 | self, |
| 524 | exit_failed_processes: list[tuple[RunningProcess, int]], |
| 525 | failed_processes: list[str], |
| 526 | ) -> list[TestFailureInfo]: |
| 527 | """Build a list of TestFailureInfo objects from failed processes.""" |
| 528 | failures: list[TestFailureInfo] = [] |
| 529 | |
| 530 | for proc, exit_code in exit_failed_processes: |
| 531 | error_snippet = extract_error_snippet(_get_output_lines(proc)) |
| 532 | failures.append( |
| 533 | TestFailureInfo( |
| 534 | test_name=_extract_test_name(proc.command), |
| 535 | command=str(proc.command), |
| 536 | return_code=exit_code, |
| 537 | output=error_snippet, |
| 538 | error_type="exit_failure", |
| 539 | ) |
| 540 | ) |
| 541 | |
| 542 | for cmd in failed_processes: |
| 543 | if isinstance(cmd, list): |
| 544 | cmd_str = subprocess.list2cmdline(cmd) |
| 545 | else: |
| 546 | cmd_str = str(cmd) |
| 547 | failures.append( |
| 548 | TestFailureInfo( |
| 549 | test_name=_extract_test_name(cmd_str), |
| 550 | command=cmd_str, |
| 551 | return_code=1, |
| 552 | output="Process was killed due to timeout/stuck detection", |
| 553 | error_type="killed_process", |
| 554 | ) |
| 555 | ) |
| 556 | |
| 557 | return failures |
| 558 | |
| 559 | def _process_active_tests( |
| 560 | self, |
no test coverage detected