Classifies infrastructure ahead of assertions when both occur.
(run: &RunResult)
| 360 | |
| 361 | /// Classifies infrastructure ahead of assertions when both occur. |
| 362 | pub fn verdict(run: &RunResult) -> ExitCode { |
| 363 | let infrastructure = run.scenarios.iter().any(|scenario| { |
| 364 | matches!(scenario.outcome(), Status::Error | Status::Blocked | Status::Cancelled) |
| 365 | }); |
| 366 | if infrastructure { |
| 367 | ExitCode::Infrastructure |
| 368 | } else if run |
| 369 | .scenarios |
| 370 | .iter() |
| 371 | .flat_map(|scenario| &scenario.checks) |
| 372 | .any(|check| check.status == Status::Failed) |
| 373 | { |
| 374 | ExitCode::Assertion |
| 375 | } else if run.passed() { |
| 376 | ExitCode::Passed |
| 377 | } else { |
| 378 | ExitCode::Infrastructure |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | /// Finds the containing repository root. |
| 383 | pub fn resolve_repo(start: Option<&Path>) -> Result<PathBuf> { |