Skip to content

fix(dotnet): parse MTP multi-line test run summary#2690

Open
guyoron1 wants to merge 1 commit into
rtk-ai:developfrom
guyoron1:fix/dotnet-mtp-multiline-summary
Open

fix(dotnet): parse MTP multi-line test run summary#2690
guyoron1 wants to merge 1 commit into
rtk-ai:developfrom
guyoron1:fix/dotnet-mtp-multiline-summary

Conversation

@guyoron1

Copy link
Copy Markdown
Contributor

Summary

The Microsoft Testing Platform (.NET 10) writes test results in a multi-line
format that the existing regexes couldn't match, causing rtk dotnet test to
report "counts unavailable" even when tests passed successfully.

Before: ok dotnet test: completed (binlog-only mode, counts unavailable, 0 warnings)
After: ok dotnet test: 72 tests passed, 0 warnings in 1 projects (1s 672ms)

Root cause

MTP outputs a multi-line summary:

Test run summary: Passed!
  total: 72
  failed: 0
  succeeded: 72
  skipped: 0
  duration: 1s 672ms

But TEST_RESULT_RE expects VSTest's single-line Passed! - Failed: 0, Passed: 72, ...
format, and TEST_SUMMARY_RE expects single-line Test summary: total: 72, failed: 0, ....
Neither matches the multi-line MTP format, so all counts stay at zero.

Fix

Add MTP_MULTILINE_SUMMARY_RE as a fallback regex in parse_test_from_text. It only
triggers when the earlier regexes find no counts (summary.total == 0), keeping backward
compatibility with VSTest and single-line MTP formats.

Changes

  • src/cmds/dotnet/binlog.rs: Add MTP_MULTILINE_SUMMARY_RE lazy_static regex and
    fallback parsing block in parse_test_from_text
  • Two new unit tests: test_parse_test_from_text_mtp_multiline_passed and
    test_parse_test_from_text_mtp_multiline_failed

Test plan

  • cargo fmt --all — no formatting issues
  • cargo clippy --all-targets — no warnings
  • cargo test --all — all tests pass (including 2 new MTP tests)
  • New tests verify both Passed! and Failed! MTP summary formats

Fixes #2279

The Microsoft Testing Platform (.NET 10) writes test results in a
multi-line format that neither TEST_RESULT_RE (VSTest) nor
TEST_SUMMARY_RE (single-line MTP) could match:

  Test run summary: Passed!
    total: 72
    failed: 0
    succeeded: 72
    skipped: 0
    duration: 1s 672ms

Add MTP_MULTILINE_SUMMARY_RE to parse this format as a fallback when
the previous regexes find no counts, so dotnet test shows actual pass/
fail numbers instead of "counts unavailable".

Fixes rtk-ai#2279
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dotnet test in binlog-only mode suppresses MTP test result counts

1 participant