Summary
The triage workflow's needs-tests check (.github/workflows/pr-triage.yml:73-75) detects an inline test addition with:
/^\+.*#\[(test\]|cfg\(test\))/m
This only matches a literal #[test] or #[cfg(test) immediately after #[. It does not match namespaced test attributes like #[tokio::test] or #[async_std::test], since the characters between #[ and test]/test) don't fit either alternative.
Impact
Any PR whose only new tests are async (#[tokio::test], which this codebase already uses throughout, e.g. crates/gl/src/agent.rs) gets falsely labeled needs-tests and receives the "no tests changed" guidance comment, even when tests were in fact added in the same commit.
Reproduced against PR #198: it added two #[tokio::test]-only tests to crates/gl/src/doctor.rs in the same commit as the source change, and the triage bot still commented needs-tests.
Fix
Widen the regex to also match any attribute ending in ::test], covering namespaced test macros regardless of depth:
/^\+.*(#\[test\]|#\[cfg\(test\)|::test\])/m
Verified against representative patches (including PR #198's actual diff) — the new regex correctly detects #[test], #[cfg(test)], #[tokio::test], and #[async_std::test], while still correctly rejecting a non-test Rust change.
I have a fix ready and will open a PR referencing this issue.
Summary
The triage workflow's
needs-testscheck (.github/workflows/pr-triage.yml:73-75) detects an inline test addition with:/^\+.*#\[(test\]|cfg\(test\))/mThis only matches a literal
#[test]or#[cfg(test)immediately after#[. It does not match namespaced test attributes like#[tokio::test]or#[async_std::test], since the characters between#[andtest]/test)don't fit either alternative.Impact
Any PR whose only new tests are async (
#[tokio::test], which this codebase already uses throughout, e.g.crates/gl/src/agent.rs) gets falsely labeledneeds-testsand receives the "no tests changed" guidance comment, even when tests were in fact added in the same commit.Reproduced against PR #198: it added two
#[tokio::test]-only tests tocrates/gl/src/doctor.rsin the same commit as the source change, and the triage bot still commentedneeds-tests.Fix
Widen the regex to also match any attribute ending in
::test], covering namespaced test macros regardless of depth:/^\+.*(#\[test\]|#\[cfg\(test\)|::test\])/mVerified against representative patches (including PR #198's actual diff) — the new regex correctly detects
#[test],#[cfg(test)],#[tokio::test], and#[async_std::test], while still correctly rejecting a non-test Rust change.I have a fix ready and will open a PR referencing this issue.