The automation-smoke contract test in tests/ci/automation-smoke-tests-contract.test.ts strips comments with two regex replacements. None of the cases below occurs in the tree today, but each one can hide a gated test from CI:
- A
//inside a string in an attribute between the gate and#[test]hides the gate. Example:#[should_panic(expected = "http://x")]. - A string containing
/*, followed later in the same file by a block comment, deletes everything between them, including any gate. The only such string today is"bytes 0-0/*"insrc-tauri/src/services/track_load/preview.rs, and that file has no later*/. #[cfg_attr(not(feature = "automation-smoke"), ignore)] #[test]gives a test that no CI run selects.
Fix:
- Replace the regex stripping with a small lexer that skips string, raw-string and char literals and tracks how deeply block comments are nested.
- Treat a
cfg_attrthat appliesignoreortestunder the feature as a gate.