Skip to content

ci: cover the ignored-test audit and make its scanner lexer-aware - #1917

Merged
zackees merged 1 commit into
mainfrom
agent/audit-ignored-tests
Nov 5, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/audit-ignored-tests

Conversation

@zackees

@zackees zackees commented Nov 5, 2026

Copy link
Copy Markdown
Member

What

ci/audit_ignored_tests.py publishes the only report anyone reads about
#[ignore] usage — the weekly Audit Ignored Tests job writes it straight into
the body of tracking issue #880 (policy: #839). It had no test, and its
detection was a line-start regex, so it could both invent an ignored test
and hide a real one.

This lands the test (ci/test_audit_ignored_tests.py, 28 cases) and makes the
scanner lexer-aware, then lowers the gate-coverage ratchet from #1915
(MAX_UNTESTED 8 -> 7, audit_ignored_tests removed from untested).

The three live defects

  1. Phantom ignored test from a string fixture. Any line that starts with
    #[ignore] was recorded, so Rust source held in r#"..."# (or in a plain
    string) counted as a real ignored test in the issue body.
  2. A '"' char literal blanked / hid code. The same class fixed in fix(ci): enforce and test the subprocess gate's documented contract #1913:
    let q = '"'; opened a string that swallowed the rest of the line — and in
    the multi-line scanner a mishandled \" escape lets one string swallow every
    following line, hiding real attributes.
  3. A scan root under a skipped directory name reported an empty inventory.
    The skip set was matched against absolute path components, so a checkout
    under .../.claude/worktrees/... (where agent worktrees actually live) or
    under any directory named target produced 0 findings instead of an error.

Detection now runs on a blanked copy of the source (code_only): nested block
comments, line comments, normal strings with escapes, raw strings with any
number of #, and char literals are replaced by spaces with columns and
newlines preserved. The reason is read back from the raw line, so
#[ignore = "why"], #[ignore = r#"why"#] and bare #[ignore] all behave as
before.

Behaviour on the real workspace is unchanged: the inventory is byte-identical
to the pre-change output (112 findings).

Proof

  • ci.test_audit_ignored_tests: 28 tests OK, including a live-workspace case
    that re-reads every reported file:line and asserts it really carries
    #[ignore].
  • RED proven in three places by mutating the production scanner in place and
    restoring it: dropping the blanking pass -> 4 failures (raw string fixture,
    block comment, code_only shape); disabling char-literal handling -> 2
    failures; absolute-path skip dirs -> test_scan_root_under_a_skipped_dir_name_is_still_scanned
    fails; and the \"-escape bug -> test_escaped_quote_does_not_swallow_the_next_line
    fails.
  • Hosted self-test set: Ran 171 tests ... OK (was 143 with ci: ratchet that every workflow-invoked gate script declares a test #1915).
  • python -m ci.gate_script_coverage --budget 7 -> "Every workflow-invoked gate script is accounted for".
  • ci/check_python_complexity.py -> "All checks passed!" (the first draft of
    code_only was C901-complex 14/10; it is split into per-token helpers).
  • ruff check on both files: clean. ci.test_local_suites confirms the module is
    registered in both entry points (ci/local_suites.py and the drift
    workflow) in the same order.

Deliberately not done

  • No change to what the report means: #[test] #[ignore] on one line and
    #[ignore = concat!(...)] are still not recorded (a test pins that the parser
    never invents a "missing reason" violation it cannot see).
  • The other 7 untested gates stay in untested; each needs its own test.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zackees
zackees added this pull request to the merge queue Nov 5, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 5, 2026
@zackees
zackees added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 99c0e86 Nov 5, 2026
31 checks passed
@zackees
zackees deleted the agent/audit-ignored-tests branch November 5, 2026 14:46
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant