Skip to content

Fix main build break: convert ToolPackageInstanceTests to MSTest (#54822) - #54954

Merged
dsplaisted merged 1 commit into
dotnet:mainfrom
dsplaisted:fix-toolpackageinstancetests-mstest
Jun 24, 2026
Merged

Fix main build break: convert ToolPackageInstanceTests to MSTest (#54822)#54954
dsplaisted merged 1 commit into
dotnet:mainfrom
dsplaisted:fix-toolpackageinstancetests-mstest

Conversation

@dsplaisted

Copy link
Copy Markdown
Member

Summary

Fixes the current main build break in Microsoft.DotNet.PackageInstall.Tests.

ToolPackageInstanceTests.cs (added by #54822) uses the xUnit [Fact] attribute, but the project was migrated to MSTest.Sdk (Migrate Microsoft.DotNet.PackageInstall.Tests to MSTest.Sdk on MTP) and no longer references xUnit, so [Fact] fails to compile:

ToolPackageInstanceTests.cs(11,10): error CS0246: The type or namespace name 'Fact' could not be found

This converts the test to [TestClass]/[TestMethod] to match the rest of the (MSTest) test project.

Root cause

A stale-base merge race: #54822 was validated on a pre-migration (xUnit) base, the MSTest migration merged in between, and #54822 was squash-merged later without re-running CI against current main. The change doesn't textually conflict, so no merge conflict surfaced and the incompatibility wasn't caught.

ToolPackageInstanceTests.cs (added by dotnet#54822) used the xUnit [Fact] attribute, but
Microsoft.DotNet.PackageInstall.Tests was migrated to MSTest.Sdk (dotnet#54822 was validated
on a pre-migration base and merged without re-running CI against current main, so the
incompatibility wasn't caught). The project no longer references xUnit, so [Fact] fails
to compile with CS0246, breaking the build on main.

Use [TestClass]/[TestMethod] to match the rest of the (MSTest) test project.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 24, 2026 00:51
@dsplaisted
dsplaisted enabled auto-merge June 24, 2026 00:51

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

Fixes a build break on main by aligning a newly added test with the project’s MSTest.Sdk migration (the test previously used xUnit’s [Fact], which no longer compiles in this project).

Changes:

  • Convert ToolPackageInstanceTests from xUnit [Fact] to MSTest [TestClass] / [TestMethod].

@dsplaisted
dsplaisted disabled auto-merge June 24, 2026 02:29
@dsplaisted

Copy link
Copy Markdown
Member Author

/ba-g Known failures, most with fixes pending in other PRs

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.

3 participants