fix(dotnet): parse MTP multi-line test run summary#2690
Open
guyoron1 wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 testtoreport "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:
But
TEST_RESULT_REexpects VSTest's single-linePassed! - Failed: 0, Passed: 72, ...format, and
TEST_SUMMARY_REexpects single-lineTest summary: total: 72, failed: 0, ....Neither matches the multi-line MTP format, so all counts stay at zero.
Fix
Add
MTP_MULTILINE_SUMMARY_REas a fallback regex inparse_test_from_text. It onlytriggers when the earlier regexes find no counts (
summary.total == 0), keeping backwardcompatibility with VSTest and single-line MTP formats.
Changes
src/cmds/dotnet/binlog.rs: AddMTP_MULTILINE_SUMMARY_RElazy_static regex andfallback parsing block in
parse_test_from_texttest_parse_test_from_text_mtp_multiline_passedandtest_parse_test_from_text_mtp_multiline_failedTest plan
cargo fmt --all— no formatting issuescargo clippy --all-targets— no warningscargo test --all— all tests pass (including 2 new MTP tests)Fixes #2279