Commit 7cddf58
authored
feat(test_context): v2.5.5 cross-language test detection + WeakPoint field (#102)
## Summary
v2.5.5 `test_context` slice — first phase (foundation). Adds the
data-model + cross-language classifier; downstream PRs wire
detector-side suppression.
## Changes
- `src/types.rs`: new `TestContext` enum (Production / TestOnly / Doc);
new `WeakPoint.test_context: Option<TestContext>` field with
serde-skip-if-none for backward compatibility.
- `src/test_context.rs`: new module with `classify_path` (Rust / Python
/ Go / JS-TS / Julia / Zig / Elixir / docs-examples) +
`content_indicates_test_scope` (ExUnit / unittest / pytest / Julia
@testset) + `classify` (path-then-content). 11 unit tests; all green.
- All 137 `WeakPoint` construction sites in `src/` get explicit
`test_context: None` (zero behaviour change — Production is the default
semantics).
## What this does NOT do (deliberate scope)
- Replace the analyzer's legacy `is_test_file` boolean — follow-up to
keep this PR reviewable.
- Suppress PanicPath findings in TestOnly code — needs the emit-site
wire-up; next slice.
- Test-data suppressions (example.com URLs, dummy creds) — next slice.
- Block-level test detection (inline pytest fixtures in production
files, Zig `test "..." {}` blocks) — file-level only here.
## Verification
- `cargo test --release --lib`: **311 pass / 0 fail** (300 baseline + 11
new test_context tests).
- `cargo build --release`: clean.
- All test_context tests cover the cross-language path patterns
documented in the ROADMAP v2.5.5 `test_context` section.
## Refs
- ROADMAP.adoc v2.5.5 `test_context` section (four items; this PR lands
the first; three follow-ups planned)
- PROOF-NEEDS.md (no impact)1 parent 55a094c commit 7cddf58
11 files changed
Lines changed: 470 additions & 0 deletions
File tree
- src
- a2ml
- assail
- kanren
- panll
- query
- storage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
| 845 | + | |
845 | 846 | | |
846 | 847 | | |
847 | 848 | | |
| |||
0 commit comments