Skip to content

is_test flag: switch test-map / dead-verdict / dead-code-SQL off path-name detection onto the stored flag; per-language test-attr detection #2253

Description

@jamie8johnson

Follow-ons declared out of scope by #2249 (the parse-time is_test flag, PR landing 693a6198). The flag now exists as a persisted v33 chunks.is_test column and the rank-time demotion knob reads it; these consumers still use the old path/name-only detection and share the same #[cfg(test)]-in-src/ blind spot the flag fixes:

  1. cqs test-map / cqs dead --verdict classify test-vs-production via is_test_chunk (path/name) — switch them to the stored is_test flag so a #[cfg(test)] fn in a src/ file is correctly classified.
  2. The dead-code SQL build_test_content_markers sniffs #[test] in chunk content, which is structurally null for cfg-test-in-src (the attribute sits outside the chunk body — chunk content starts at fn). Same gap, same fix as (1): read the stored flag instead. (1) and (2) are one lane.
  3. Non-Rust attribute detection: the other 53 languages get only the registry path/name layer — no per-language #[test]-equivalent AST detection (pytest markers, JUnit @Test, Go func TestXxx, etc.). The flag's parse-time computation has per-language extension points left open; populate them where a language has a first-class test marker.

Priority: (1)+(2) are the natural immediate follow-up (they make the flag's benefit reach the test-map/dead surfaces, and they're the same blind spot). (3) is lower — the registry patterns already cover conventional layouts for all languages; per-language AST detection only matters for in-file test markers like Rust's #[cfg(test)], which most languages express via file/dir convention anyway.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions