(self, result: TestResult, runtests: RunTests)
| 98 | return exitcode |
| 99 | |
| 100 | def accumulate_result(self, result: TestResult, runtests: RunTests) -> None: |
| 101 | test_name = result.test_name |
| 102 | rerun = runtests.rerun |
| 103 | fail_env_changed = runtests.fail_env_changed |
| 104 | |
| 105 | match result.state: |
| 106 | case State.PASSED: |
| 107 | self.good.append(test_name) |
| 108 | case State.ENV_CHANGED: |
| 109 | self.env_changed.append(test_name) |
| 110 | self.rerun_results.append(result) |
| 111 | case State.SKIPPED: |
| 112 | self.skipped.append(test_name) |
| 113 | case State.RESOURCE_DENIED: |
| 114 | self.resource_denied.append(test_name) |
| 115 | case State.INTERRUPTED: |
| 116 | self.interrupted = True |
| 117 | case State.DID_NOT_RUN: |
| 118 | self.run_no_tests.append(test_name) |
| 119 | case _: |
| 120 | if result.is_failed(fail_env_changed): |
| 121 | self.bad.append(test_name) |
| 122 | self.rerun_results.append(result) |
| 123 | else: |
| 124 | raise ValueError(f"invalid test state: {result.state!r}") |
| 125 | |
| 126 | if result.state == State.WORKER_BUG: |
| 127 | self.worker_bug = True |
| 128 | |
| 129 | if result.has_meaningful_duration() and not rerun: |
| 130 | if result.duration is None: |
| 131 | raise ValueError("result.duration is None") |
| 132 | self.test_times.append((result.duration, test_name)) |
| 133 | if result.stats is not None: |
| 134 | self.stats.accumulate(result.stats) |
| 135 | if rerun: |
| 136 | self.rerun.append(test_name) |
| 137 | if result.covered_lines: |
| 138 | # we don't care about trace counts so we don't have to sum them up |
| 139 | self.covered_lines.update(result.covered_lines) |
| 140 | xml_data = result.xml_data |
| 141 | if xml_data: |
| 142 | self.add_junit(xml_data) |
| 143 | |
| 144 | def get_coverage_results(self) -> trace.CoverageResults: |
| 145 | counts = {loc: 1 for loc in self.covered_lines} |
no test coverage detected