Skip to content

Migrate dotnet-MsiInstallation.Tests to MSTest.Sdk on MTP#54901

Merged
Evangelink merged 2 commits into
dotnet:mainfrom
Evangelink:evangelink/mstest-mtp-msiinstallation-tests
Jun 22, 2026
Merged

Migrate dotnet-MsiInstallation.Tests to MSTest.Sdk on MTP#54901
Evangelink merged 2 commits into
dotnet:mainfrom
Evangelink:evangelink/mstest-mtp-msiinstallation-tests

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Part of the ongoing xUnit -> MSTest.Sdk (MTP) test migration of the .NET SDK test suite, following the same pattern as the other open migration PRs (builds on the foundation merged in #54845).

Preserves the Windows-only test-app behaviour (non-Windows builds as a plain library via IsTestApplication=false); the [Collection] VM serialization becomes [DoNotParallelize] (inherited by the derived test classes).

Standard transformations: Microsoft.NET.Sdk -> MSTest.Sdk, the TestFramework project reference -> Microsoft.NET.TestFramework.MSTest, [Fact]/[Theory] -> [TestMethod], [InlineData] -> [DataRow], xUnit asserts -> MSTest (including the repo Recommended-mode idiomatic asserts), and ITestOutputHelper constructor injection removed in favour of the base SdkTest Log / TestContext.

Builds clean for the SDK target framework.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 19, 2026 18:26

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

Migrates the dotnet-MsiInstallation.Tests VM-based MSI installation test project from xUnit to MSTest.Sdk (Microsoft Testing Platform), aligning it with the repo’s ongoing xUnit → MSTest migration strategy.

Changes:

  • Switched test project SDK and references to MSTest.Sdk + Microsoft.NET.TestFramework.MSTest, and added needed Using items for MSTest-based builds.
  • Converted xUnit attributes to MSTest equivalents ([Fact]/[Theory][TestMethod], [InlineData][DataRow], Skip[Ignore]) and removed ITestOutputHelper ctor injection.
  • Replaced xUnit collection-based serialization with MSTest parallelization control via [DoNotParallelize] on the VM base class.
Show a summary per file
File Description
test/dotnet-MsiInstallation.Tests/WorkloadSetTestsBase.cs Updates base test class ctor to MSTest-style (no output helper injection).
test/dotnet-MsiInstallation.Tests/WorkloadSetTests2.cs Converts test class/attributes to MSTest and adds [TestClass].
test/dotnet-MsiInstallation.Tests/WorkloadSetTests.cs Converts test class/attributes to MSTest, including skip handling via [Ignore].
test/dotnet-MsiInstallation.Tests/VSWorkloadTests.cs Converts test class/attributes to MSTest and removes output-helper ctor injection.
test/dotnet-MsiInstallation.Tests/MsiInstallerTests.cs Converts test class/attributes to MSTest and removes output-helper ctor injection.
test/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs Updates VM test base for MSTest, including removing xUnit collection usage.
test/dotnet-MsiInstallation.Tests/dotnet-MsiInstallation.Tests.csproj Switches to MSTest.Sdk, updates test framework reference, and adds MSTest-specific global usings.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 2

Comment thread test/dotnet-MsiInstallation.Tests/Framework/VMTestBase.cs Outdated
Comment thread test/dotnet-MsiInstallation.Tests/VSWorkloadTests.cs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Evangelink

Copy link
Copy Markdown
Member Author

/ba-g unrelated razor test:

Exception Message

Expected value to be 0 because Expected command to pass but it did not.
Working Directory: /private/tmp/helix/working/A8100924/t/dotnetSdkTests.xRYmF5XE/Publish_WithP---7D4040F0
File Name: /tmp/helix/working/A8100924/p/d/dotnet
Arguments: msbuild /t:Publish /private/tmp/helix/working/A8100924/t/dotnetSdkTests.xRYmF5XE/Publish_WithP---7D4040F0/AppWithP2PReference/AppWithP2PReference.csproj /p:_IsPublishing=true /restore /p:BuildProjectReferences=false /p:ErrorOnDuplicatePublishOutputFiles=false /bl
Exit Code: 139
StdOut:
MSBuild version 18.9.0-preview-26311-113+50e862b8d for .NET
  Determining projects to restore...
[createdump] Gathering state for process 87429
[createdump] Crashing thread ce87a signal 11 (000b)
[createdump] Writing crash report to file /tmp/helix/working/A8100924/w/C2720A2E/uploads/coredump.87429.crashreport.json
[createdump] Crash report successfully written
[createdump] Writing full dump to file /tmp/helix/working/A8100924/w/C2720A2E/uploads/coredump.87429
[createdump] Written 6898913704 bytes (421076 pages) to core file
[createdump] Target process is alive
[createdump] Dump successfully written in 41624ms
StdErr:
, but found 139 (difference of 139).

CallStack

at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
   at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
   at FluentAssertions.Execution.AssertionChain.FailWith(Func`1 getFailureReason)
   at Microsoft.NET.TestFramework.Assertions.CommandResultAssertions.Pass() in /_/test/Microsoft.NET.TestFramework/Assertions/CommandResultAssertions.cs:line 27
   at Microsoft.NET.Sdk.Razor.Tests.PublishIntegrationTest.Publish_WithP2P_WorksWhenBuildProjectReferencesIsDisabled() in /_/test/Microsoft.NET.Sdk.Razor.Tests/PublishIntegrationTest.cs:line 184
   at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
   at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

@Evangelink Evangelink merged commit 32dc10f into dotnet:main Jun 22, 2026
30 of 32 checks passed
@Evangelink Evangelink deleted the evangelink/mstest-mtp-msiinstallation-tests branch June 22, 2026 16:43
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants