Summary
main.rs contains the bulk pipeline orchestration — run_single_test_file, run_all_test_files, run_discovered_file — with critical error handling, multi-file summary, and teardown logic, but these functions have zero test coverage. The existing integration test re-implements the pipeline rather than calling these functions.
Severity: S2 (Medium) | Confidence: 0.90 | Blast radius: Medium — regressions in the most user-facing code path go undetected.
Technical Details
Untested orchestration functions in src/main.rs:
| Function |
Lines |
What it does |
run_single_test_file |
158-580 |
Full single-file pipeline: config load → commands → execution → report |
run_all_test_files |
587-670 |
Multi-file orchestration with summary aggregation |
run_discovered_file |
679-780 |
Discovery-mode wrapper with glob matching |
What is currently tested:
src/main.rs lines 810-946: 10 tests, but they only cover CLI argument parsing via Cli::parse_from
tests/pipeline_integration.rs: Tests individual phases (command execution, step execution) using a mock provider, but does not call run_single_test_file or run_all_test_files
What's at risk without coverage:
- Error handling and graceful degradation when commands fail mid-pipeline
- Multi-file summary aggregation logic (exit code selection, report merging)
- Best-effort teardown ordering (processes killed in correct order on failure)
- Config validation + merge logic in the orchestration path
- Edge cases: empty test files, all steps skipped, provider init failure
Proposed Fix
-
Refactor for testability: Extract an AgentSessionFactory trait or closure parameter so run_single_test_file can accept a mock provider:
pub fn run_single_test_file(
config: &Config,
test_file: &TestFile,
session_factory: impl Fn(&Config) -> Box<dyn AgentSession>,
// ...
) -> Result<RunResult, PipelineError>
-
Write integration tests that call run_single_test_file directly:
- Happy path: all steps pass
- Command failure: short-lived command exits non-zero
- Provider failure: session init returns error
- Partial success: some steps pass, some fail
- Teardown verification: long-lived processes are cleaned up
-
Write a multi-file test for run_all_test_files:
- Two test files, one passes, one fails → verify correct exit code and summary
Estimated effort: 1-2 days
Related
- Related to F9: shared test infrastructure needed first
- Part of refactor Bundle 8: Orchestration Test Coverage
🔍 Found by vibe-code-audit — automated codebase audit skill for Claude Code.
Summary
main.rscontains the bulk pipeline orchestration —run_single_test_file,run_all_test_files,run_discovered_file— with critical error handling, multi-file summary, and teardown logic, but these functions have zero test coverage. The existing integration test re-implements the pipeline rather than calling these functions.Severity: S2 (Medium) | Confidence: 0.90 | Blast radius: Medium — regressions in the most user-facing code path go undetected.
Technical Details
Untested orchestration functions in
src/main.rs:run_single_test_filerun_all_test_filesrun_discovered_fileWhat is currently tested:
src/main.rslines 810-946: 10 tests, but they only cover CLI argument parsing viaCli::parse_fromtests/pipeline_integration.rs: Tests individual phases (command execution, step execution) using a mock provider, but does not callrun_single_test_fileorrun_all_test_filesWhat's at risk without coverage:
Proposed Fix
Refactor for testability: Extract an
AgentSessionFactorytrait or closure parameter sorun_single_test_filecan accept a mock provider:Write integration tests that call
run_single_test_filedirectly:Write a multi-file test for
run_all_test_files:Estimated effort: 1-2 days
Related