Add support for NUnitV3 content inside TouchUnit result files.#1505
Merged
rolfbjarne merged 3 commits intodotnet:mainfrom Dec 1, 2025
Merged
Add support for NUnitV3 content inside TouchUnit result files.#1505rolfbjarne merged 3 commits intodotnet:mainfrom
rolfbjarne merged 3 commits intodotnet:mainfrom
Conversation
Member
rolfbjarne
commented
Nov 21, 2025
- Add a new TouchUnit_NUnitV3 xml result jargon.
- Refactor the TouchUnit test report generator to call into the NUnitV2 or NUnitV3 test report generators depending on the embedded content.
- Simplify the NUnitV3 test report generator to just look for 'test-case' elements, not caring about any parent nodes.
- Make the NUnitV3 test report print the full name of failing tests, not just the name.
* Add a new TouchUnit_NUnitV3 xml result jargon. * Refactor the TouchUnit test report generator to call into the NUnitV2 or NUnitV3 test report generators depending on the embedded content. * Simplify the NUnitV3 test report generator to just look for 'test-case' elements, not caring about any parent nodes. * Make the NUnitV3 test report print the full name of failing tests, not just the name.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for NUnitV3-formatted content within TouchUnit result files, previously only NUnitV2 format was supported. The implementation introduces a new TouchUnit_NUnitV3 XML result jargon while maintaining backward compatibility through an enum alias (TouchUnit_NUnitV2 = TouchUnit). The core change refactors the TouchUnitTestReportGenerator to detect the embedded format and delegate to the appropriate NUnitV2 or NUnitV3 test report generator, simplifying the code and eliminating duplication.
Key changes:
- Introduces
TouchUnit_NUnitV3enum value with backward-compatible alias forTouchUnit - Detection logic in XmlResultParser distinguishes between TouchUnit variants based on presence of 'test-run' (NUnitV3) or 'test-results' (NUnitV2) elements
- NUnitV3TestReportGenerator simplified to iterate through all test-case elements using fullname instead of name for failed tests
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.DotNet.XHarness.Common/XmlResultJargon.cs | Adds TouchUnit_NUnitV3 enum value and backward-compatible alias TouchUnit_NUnitV2 = TouchUnit |
| src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/XmlResultParser.cs | Updates detection logic to distinguish between TouchUnit variants and adds both to the formatters dictionary |
| src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/TouchUnitTestReportGenerator.cs | Refactored to delegate to NUnitV2 or NUnitV3 generators based on detected element name |
| src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/NUnitV3TestReportGenerator.cs | Simplified to iterate all test-case elements directly; changed to use fullname attribute instead of name |
| src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/NUnitV2TestReportGenerator.cs | Added check to handle reader already positioned at test-results element |
| tests/Microsoft.DotNet.XHarness.iOS.Shared.Tests/XmlResultParserTests.cs | Updated tests for new enum values and added two new test methods for TouchUnit report generation |
| tests/Microsoft.DotNet.XHarness.iOS.Shared.Tests/Microsoft.DotNet.XHarness.iOS.Shared.Tests.csproj | Added TouchUnitSample2.xml as embedded resource for testing |
tests/Microsoft.DotNet.XHarness.iOS.Shared.Tests/XmlResultParserTests.cs
Outdated
Show resolved
Hide resolved
tests/Microsoft.DotNet.XHarness.iOS.Shared.Tests/XmlResultParserTests.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.DotNet.XHarness.iOS.Shared/XmlResults/NUnitV2TestReportGenerator.cs
Show resolved
Hide resolved
kotlarmilos
approved these changes
Dec 1, 2025
…erTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…erTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
kotlarmilos
pushed a commit
to kotlarmilos/xharness
that referenced
this pull request
Mar 16, 2026
…t#1505) * Add support for NUnitV3 content inside TouchUnit result files. * Add a new TouchUnit_NUnitV3 xml result jargon. * Refactor the TouchUnit test report generator to call into the NUnitV2 or NUnitV3 test report generators depending on the embedded content. * Simplify the NUnitV3 test report generator to just look for 'test-case' elements, not caring about any parent nodes. * Make the NUnitV3 test report print the full name of failing tests, not just the name.
kotlarmilos
pushed a commit
to kotlarmilos/xharness
that referenced
this pull request
Mar 16, 2026
…t#1505) * Add support for NUnitV3 content inside TouchUnit result files. * Add a new TouchUnit_NUnitV3 xml result jargon. * Refactor the TouchUnit test report generator to call into the NUnitV2 or NUnitV3 test report generators depending on the embedded content. * Simplify the NUnitV3 test report generator to just look for 'test-case' elements, not caring about any parent nodes. * Make the NUnitV3 test report print the full name of failing tests, not just the name.
kotlarmilos
pushed a commit
to kotlarmilos/xharness
that referenced
this pull request
Mar 16, 2026
…t#1505) * Add support for NUnitV3 content inside TouchUnit result files. * Add a new TouchUnit_NUnitV3 xml result jargon. * Refactor the TouchUnit test report generator to call into the NUnitV2 or NUnitV3 test report generators depending on the embedded content. * Simplify the NUnitV3 test report generator to just look for 'test-case' elements, not caring about any parent nodes. * Make the NUnitV3 test report print the full name of failing tests, not just the name.
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.