Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

#660 Harden the automation-smoke contract test's comment stripping

open

Opened by dev · last week

devopened this issueAuthor· last week

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:

  1. A // inside a string in an attribute between the gate and #[test] hides the gate. Example: #[should_panic(expected = "http://x")].
  2. 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/*" in src-tauri/src/services/track_load/preview.rs, and that file has no later */.
  3. #[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_attr that applies ignore or test under the feature as a gate.

Sign in to comment.

Linked pull requests

No linked pull requests yet.