`rtk dotnet test` counts a project once per output line that names its `.csproj`
rtk dotnet test reports one project per output line that names a .csproj, so warnings inflate the in N projects count.
Measured with the .NET 10.0.400 SDK on a solution with two xunit test projects, develop 7e92da00a:
| command | native | rtk dotnet … |
|---|---|---|
test -v q --filter 'FullyQualifiedName~Tests2.', restore printing 4 warning NU1900 lines (two per project) |
2 test projects run (A total of 1 test files matched twice) |
fail dotnet test: 1 passed, 1 failed, 0 skipped, 4 warnings in 4 projects |
binlog::parse_test_from_text sets project_count: count_projects(&scrubbed).max(1), and count_projects counts every PROJECT_PATH_RE match in the whole output. Each warning line names its project, so a project named in two warning lines is counted twice. The TRX-derived count (2 here) only replaces it when larger (trx_summary.project_count > summary.project_count), so the console count wins. Reproduced on develop with plain rtk dotnet test and with --logger trx; that line of parse_test_from_text has been there since v0.34.2.
A fix would count distinct projects, for example from the Test run for <dll> or Failed!/Passed! … - <dll> lines, rather than path matches.
wshm · Automated triage by AI
🔍 Automated Triage
| 🐛 Category | bug |
| 🟡 Priority | medium |
| 🎯 Confidence | 95% |
Summary
dotnet test's project_count double-counts projects named in multiple output lines (e.g. restore warnings), inflating 'in N projects'; count distinct projects instead of path matches.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use
/wshm fixto attempt it.
📁 Relevant files
src/binlog.rs
Suggested Actions
- Fix count_projects/parse_test_from_text to dedupe by distinct project path, not raw PROJECT_PATH_RE matches
- Consider deriving count from 'Test run for
' or 'Passed!/Failed! ... - ' lines instead - Add regression test with a solution producing multiple restore warning lines per project
- Verify TRX-derived project_count fallback logic still behaves once console count is fixed
Triaged automatically by wshm · This is an automated analysis, not a human review.
Claiming this 🙌 Fix is up in #4845 — counts distinct projects from the Test run for <dll> / Passed! - … - <dll> lines instead of path matches, with distinct .csproj paths as fallback for SDKs that don't print those lines. Both output shapes from the report are covered by tests. Feedback welcome!
There are 2 open pull requests for this issue: #4845, #4846 (oldest first).
If you were about to start on it, reviewing or testing one of these helps more than another pull request: a note on which approach fits, or a test result on your setup, is welcome on the pull request itself.