Skip to content

Normalize TestIdentity.Assembly across adapters - #111

Merged
xping-admin merged 2 commits into
mainfrom
bugfix/109/normalize-testidentity-assembly
Aug 9, 2026
Merged

Normalize TestIdentity.Assembly across adapters#111
xping-admin merged 2 commits into
mainfrom
bugfix/109/normalize-testidentity-assembly

Conversation

@xping-admin

Copy link
Copy Markdown
Collaborator

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

… the namespace root, xUnit the full display name

Fixes #109
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Xping.Sdk.MSTest/XpingTestBase.cs 50.00% 0 Missing and 2 partials ⚠️
src/Xping.Sdk.XUnit/XpingTestFrameworkExecutor.cs 66.66% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
src/Xping.Sdk.XUnit/XpingMessageSink.cs 67.55% <100.00%> (+0.73%) ⬆️
src/Xping.Sdk.XUnit/XpingTestFrameworkExecutor.cs 93.33% <66.66%> (-6.67%) ⬇️
src/Xping.Sdk.MSTest/XpingTestBase.cs 43.95% <50.00%> (+33.62%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AssemblyName into XpingMessageSink rather than using IAssemblyInfo.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.

Comment thread tests/Xping.Sdk.MSTest.Tests/XpingTestBaseAssemblyNameTests.cs
Comment thread src/Xping.Sdk.MSTest/XpingTestBase.cs Outdated
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>
@xping-admin
xping-admin merged commit 0ba2132 into main Aug 9, 2026
1 of 2 checks passed
@xping-admin
xping-admin deleted the bugfix/109/normalize-testidentity-assembly branch August 9, 2026 19:21
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.

TestIdentity.Assembly is inconsistent across adapters: MSTest reports the namespace root, xUnit the full display name

2 participants