Labels: testing, cli-crate
Crate: cli
Description
Every test in crates/cli/tests/fixture_scans.rs calls soroban_guard_analyzer::scan_directory (imported at line 1), which internally calls dedup_findings before returning. But issue #309 established that the actual CLI (crates/cli/src/main.rs) calls scan_directory_with_checks instead — which, per crates/analyzer/src/lib.rs, does not call dedup_findings at all.
This means the entire fixture test suite validates a code path real users never take, and is structurally incapable of catching CLI-path-specific bugs like duplicate findings (e.g. the AuthAfterStorageWriteCheck double-registration filed separately) — scan_directory's dedup step silently absorbs exactly that kind of defect before the test ever sees it. This is a different gap than the already-open #291 (which is about missing coverage for most checks); this is about the coverage that already exists testing the wrong underlying function.
Acceptance Criteria
Difficulty: intermediate
Labels: testing, cli-crate
Crate: cli
Description
Every test in
crates/cli/tests/fixture_scans.rscallssoroban_guard_analyzer::scan_directory(imported at line 1), which internally callsdedup_findingsbefore returning. But issue #309 established that the actual CLI (crates/cli/src/main.rs) callsscan_directory_with_checksinstead — which, percrates/analyzer/src/lib.rs, does not calldedup_findingsat all.This means the entire fixture test suite validates a code path real users never take, and is structurally incapable of catching CLI-path-specific bugs like duplicate findings (e.g. the
AuthAfterStorageWriteCheckdouble-registration filed separately) —scan_directory's dedup step silently absorbs exactly that kind of defect before the test ever sees it. This is a different gap than the already-open #291 (which is about missing coverage for most checks); this is about the coverage that already exists testing the wrong underlying function.Acceptance Criteria
fixture_scans.rs(or a new integration test file) that goes throughscan_directory_with_checks+default_checks_with_config(...), matching the CLI's real invocation, and assert it produces no duplicate(file, line, check_name)findings.assert_fixture_pairshould be parameterized to run against both entry points.Difficulty: intermediate