Normalize TestIdentity.Assembly across adapters - #111
Merged
Conversation
… the namespace root, xUnit the full display name Fixes #109
Codecov Report❌ Patch coverage is
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR normalizes how TestIdentity.Assembly is populated across the xUnit and MSTest adapters so that the SDK consistently records the simple assembly name, enabling reliable server-side grouping/filtering and addressing issue #109.
Changes:
- xUnit: propagate the simple assembly name from the runner’s
AssemblyNameintoXpingMessageSinkrather than usingIAssemblyInfo.Name(display name). - MSTest: resolve the assembly name via reflection (test method/type) with a fallback heuristic when the type can’t be resolved.
- Add regression tests in xUnit and MSTest test projects to lock in the expected simple-name behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/Xping.Sdk.XUnit.Tests/XpingMessageSinkAssemblyNameTests.cs | Adds a regression test ensuring xUnit uses the constructor-supplied simple assembly name rather than the display name. |
| tests/Xping.Sdk.MSTest.Tests/XpingTestBaseAssemblyNameTests.cs | Adds regression tests ensuring MSTest resolves the real assembly simple name (with a fallback for unresolvable types). |
| src/Xping.Sdk.XUnit/XpingTestFrameworkExecutor.cs | Captures and forwards the simple assembly name into the message sink during test execution. |
| src/Xping.Sdk.MSTest/XpingTestBase.cs | Resolves assembly name and pinned fingerprint from reflection data instead of parsing namespace/class name strings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
FindTestMethodForContext searches inherited methods too, so for a test method inherited from a base fixture, DeclaringType would be the base class rather than the concrete test class — reintroducing the wrong assembly if that base class lives in a different assembly. ReflectedType is always the resolved class itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
TestIdentity.Assembly is now consistently populated across NUnit, xUnit, and MSTest adapters. The xUnit adapter has been updated to use the simple assembly name instead of the full display name, and the MSTest adapter now resolves the assembly name from the test class type rather than relying on the namespace root. This change ensures reliable cloud-side grouping and filtering by assembly, addressing the inconsistencies outlined in issue #109. Additionally, cross-adapter tests have been added to verify that all adapters record the same assembly name format.
Fixes #109