Skip to content

Pack props into buildTransitive so MTP registration flows to transitive consumers#80

Merged
Tyrrrz merged 2 commits into
Tyrrrz:primefrom
jetersen:pack-props-buildtransitive
Jul 25, 2026
Merged

Pack props into buildTransitive so MTP registration flows to transitive consumers#80
Tyrrrz merged 2 commits into
Tyrrrz:primefrom
jetersen:pack-props-buildtransitive

Conversation

@jetersen

Copy link
Copy Markdown
Contributor

Problem

In Microsoft.Testing.Platform mode, the extension registers itself through the TestingPlatformBuilderHook item declared in GitHubActionsTestLogger.props. That props file is packed only into build/, and NuGet imports build/ assets only for direct package referencesbuildTransitive/ is the folder that flows to transitive consumers.

So when the package is consumed transitively — e.g. an organization's shared testing package declares GitHubActionsTestLogger as a dependency so every test project gets it — the compile/runtime assets arrive fine, but the builder hook item never reaches the test project. The source-generated SelfRegisteredExtensions omits the extension and the reporter silently never runs.

Fix

Pack the same props file into both folders:

<Content Include="GitHubActionsTestLogger.props" Pack="true" PackagePath="build;buildTransitive" />

VSTest usage is unaffected (the logger assembly already flows transitively to the build output where VSTest discovers it; the props only matter for MTP registration).

Validation

Scenario: Consumer (xunit.v3.mtp-v2 test project) → references TestKit (packaged class library) → depends on GitHubActionsTestLogger. No direct reference from Consumer.

Package GitHubActionsTestLogger.MtpIntegration.AddExtensions in generated SelfRegisteredExtensions.cs
3.0.4 (build/ only) ❌ absent — extension never registers
this branch (build/ + buildTransitive/) ✅ present

Also verified the produced nupkg contains both build/GitHubActionsTestLogger.props and buildTransitive/GitHubActionsTestLogger.props.

@Tyrrrz Tyrrrz added the enhancement New feature or request label Jul 24, 2026
@Tyrrrz
Tyrrrz requested a review from Copilot July 24, 2026 09:23

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 fixes Microsoft.Testing.Platform (MTP) self-registration when GitHubActionsTestLogger is consumed transitively by ensuring the package’s .props file is available under buildTransitive/ (not just build/), allowing the TestingPlatformBuilderHook item to flow to downstream test projects.

Changes:

  • Pack GitHubActionsTestLogger.props into both build/ and buildTransitive/ so MTP registration works for transitive consumers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Tyrrrz

Tyrrrz commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Please run dotnet build to fix formatting

@jetersen

Copy link
Copy Markdown
Contributor Author

Done 😅

@Tyrrrz
Tyrrrz merged commit 9896739 into Tyrrrz:prime Jul 25, 2026
7 checks passed
@Tyrrrz

Tyrrrz commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Thanks!

@jetersen
jetersen deleted the pack-props-buildtransitive branch July 25, 2026 16:33
@jetersen

Copy link
Copy Markdown
Contributor Author

👏🎉 Thank you!

This was referenced Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants