Migrate Microsoft.NET.Build.Containers test projects to MSTest - #54842
Merged
Evangelink merged 33 commits intoJun 23, 2026
Merged
Conversation
…n MTP
This is a pathfinder PR for migrating the test suite to MSTest on
Microsoft.Testing.Platform (MTP). Microsoft.DotNet.HotReload.Watch.Aspire.Tests
was chosen because it has no dependency on the shared Microsoft.NET.TestFramework
(which is xUnit-coupled and referenced by ~57 of 78 test projects), so it can
migrate in isolation without unblocking dependents first.
Changes:
* global.json: add MSTest.Sdk 4.3.0-preview.26307.5 to msbuild-sdks.
* test/Directory.Build.targets: gate the xUnit defaults
(TestRunnerName=XUnitV3, Using Include=Xunit, etc.) behind
$(UseMSTestSdk) != true, so MSTest.Sdk projects opt out cleanly.
* test/Microsoft.DotNet.HotReload.Watch.Aspire.Tests:
- csproj now uses Sdk="MSTest.Sdk", sets UseMSTestSdk=true, references
AwesomeAssertions and only the Watch.Aspire project. MTP is on by default
via MSTest.Sdk (EnableMSTestRunner + TestingPlatformDotnetTestSupport).
- All 4 unit-test files converted from xUnit to MSTest attributes/asserts
([Fact]/[Theory] -> [TestMethod]/[DataRow], Assert.* equivalents,
Assert.IsInstanceOfType<T>, Assert.HasCount, Assert.IsEmpty).
- Local AssertEx.SequenceEqual<T> helper replaces the xUnit-coupled one
from HotReload.Test.Utilities.
* Move the 2 integration tests (AspireLauncherTests + PipeUtilities) to
test/dotnet-watch.Tests/Aspire/ so the Aspire.Tests project stays a pure
MSTest unit-test project. They keep xUnit because they depend on
WatchSdkTest, WatchableApp, [PlatformSpecificFact], ITestOutputHelper and
TestAssets from Microsoft.NET.TestFramework. AspireLauncherTests was
renamed to AspireLauncherIntegrationTests to reflect its new role.
* src/Dotnet.Watch/Watch.Aspire/Properties/AssemblyInfo.cs: grant
InternalsVisibleTo to dotnet-watch.Tests (needed by PipeUtilities, which
uses internal WatchStatusEvent).
* test/dotnet-watch.Tests/dotnet-watch.Tests.csproj: add ProjectReference to
Watch.Aspire (ExcludeAssets=Runtime) so the moved integration tests
compile.
Verification:
* Microsoft.DotNet.HotReload.Watch.Aspire.Tests builds with MSTest.Sdk and
all 58 unit tests pass under MTP (705 ms).
* test/dotnet-watch.Tests builds successfully with the moved files.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Bumps MSTest.Sdk to the latest internal preview to pick up the newest 4.3 assertion APIs (Assert.ContainsSingle, Assert.Contains for strings with the more natural (needle, haystack) signature, etc.). - Applies the assertion mapping flagged by the migrate-xunit-to-mstest skill in this repo (.github/skills/migrate-xunit-to-mstest, PR dotnet#54727): Assert.HasCount(1, x) -> Assert.ContainsSingle(x) (one occurrence in AspireResourceLauncherCliTests.cs) Verified: 58/58 tests still pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…parity Per reviewer feedback: MSTest 4.1.0+ exposes Assert.IsExactInstanceOfType<T>(value) which returns T and enforces exact-type semantics -- the proper equivalent of xUnit's Assert.IsType<T>(x). Assert.IsInstanceOfType<T> is the equivalent of xUnit's Assert.IsAssignableFrom<T> (assignable, not exact), which would be a silent semantic regression for the IsType<T> originals. All 39 occurrences across AspireHostLauncherCliTests.cs, AspireResourceLauncherCliTests.cs, AspireServerLauncherCliTests.cs, and AspireLauncherIntegrationTests.cs were originally Assert.IsType<T> in xUnit (verified against main), so all 39 are flipped to Assert.IsExactInstanceOfType<T>. Note: the migrate-xunit-to-mstest skill cheatsheet at .github/skills/migrate-xunit-to-mstest/references/mapping-cheatsheet.md recommends `Assert.IsInstanceOfType<T>` plus an extra typeof-check for exact-type semantics; that guidance predates IsExactInstanceOfType being available. Follow-up upstream (dotnet/skills) suggested. Verified: 58/58 Aspire tests still pass; dotnet-watch.Tests builds clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MSTest.Sdk already adds this as an implicit global using. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
MSTest 4.3+ provides Assert.AreSequenceEqual for element-wise IEnumerable<T> compare with a nice diff message, so the project-local AssertEx helper is no longer needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…est/Directory.Build.targets Per @Evangelink: keep per-csproj boilerplate minimal. FluentAssertions is now a global using for any test project (gated on IsTestProject OR UsingMSTestSdk), and AwesomeAssertions is added as a PackageReference for MSTest.Sdk projects. xUnit projects continue to pick it up transitively via Microsoft.NET.TestFramework. The Microsoft.NET.TestFramework.* and Xunit usings remain gated on the xUnit branch (UsingMSTestSdk != true) because MSTest projects in this repo do not reference Microsoft.NET.TestFramework; making those usings global would fail with CS0246. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The recent `Helix dispatcher: gate --report-trx on TrxReport extension
being loaded` commit accidentally removed the ProjectReference to
Microsoft.DotNet.HotReload.Watch.Aspire from dotnet-watch.Tests.csproj
(introduced in the `Migrate Microsoft.DotNet.HotReload.Watch.Aspire.Tests
to MSTest.Sdk on MTP` commit to allow the moved AspireLauncherIntegrationTests
and PipeUtilities to compile).
Without that reference, the build fails with:
error CS0246: The type or namespace name 'WatchStatusEvent' could not be
found (are you missing a using directive or an assembly reference?)
[test/dotnet-watch.Tests/Aspire/PipeUtilities.cs]
Re-add the ProjectReference.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Introduces an MSTest-flavored counterpart to the xUnit-based Microsoft.DotNet.HotReload.Test.Utilities so that test helpers that need MSTest's TestContext (e.g. TestLogger, TestLoggerFactory) can be shared across MSTest.Sdk test projects instead of being copy-pasted per project. This commit also migrates the inline TestLogger from Microsoft.DotNet.HotReload.Client.Tests to consume the shared project, which serves as the first reference consumer. Subsequent migration PRs (DeltaApplier.Tests, Containers.UnitTests) will adopt the same project reference instead of adding their own TestLogger/TestLoggerFactory copies. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Switch SDK to MSTest.Sdk; set UseMSTestSdk=true to opt out of test/Directory.Build.targets xUnit defaults. - Replace [Fact]/[Theory] + [InlineData] with [TestMethod] + [DataRow]. - Replace Xunit.Combinatorial with Combinatorial.MSTest 2.0.0 (added to eng/dependabot/Packages.props). - Replace ITestOutputHelper with TestContext via a project-local TestLogger. - Replace xUnit assertions with MSTest assertions and remove the Microsoft.NET.TestFramework reference. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Sdk)
MSTest.Sdk already sets $(UsingMSTestSdk)=true in its Sdk.props before
Directory.Build.props is evaluated, so the custom <UseMSTestSdk>true</UseMSTestSdk>
opt-in property is redundant. This change:
- Removes <UseMSTestSdk>true</UseMSTestSdk> from MSTest.Sdk csproj(s).
- Renames $(UseMSTestSdk) -> $(UsingMSTestSdk) in test/Directory.Build.targets
(the xUnit-defaults gating condition) and in xunit-runner/{XUnitPublish,XUnitRunner}.targets
(Helix MTP dispatcher detection).
--report-trx is an MTP CLI argument provided only when the Microsoft.Testing.Extensions.TrxReport extension is loaded on the test host. MSTest.Sdk's Default/AllMicrosoft profiles enable it by default, but other MTP runners (e.g. xUnit v3 MTP) do not bundle the extension, so passing --report-trx to those hosts fails with 'unknown argument'. XUnitPublish.targets now exposes the GetTrxReportEnabled target which returns the value of EnableMicrosoftTestingExtensionsTrxReport. XUnitRunner.targets calls that target and propagates the value as the EnableTrxReport metadata of SDKCustomXUnitProject items. SDKCustomCreateXUnitWorkItemsWithTestExclusion reads that metadata and only appends --report-trx to the MTP command line when it is true. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The recent `Helix dispatcher: gate --report-trx on TrxReport extension
being loaded` commit accidentally removed the ProjectReference to
Microsoft.DotNet.HotReload.Watch.Aspire from dotnet-watch.Tests.csproj
(introduced in the `Migrate Microsoft.DotNet.HotReload.Watch.Aspire.Tests
to MSTest.Sdk on MTP` commit to allow the moved AspireLauncherIntegrationTests
and PipeUtilities to compile).
Without that reference, the build fails with:
error CS0246: The type or namespace name 'WatchStatusEvent' could not be
found (are you missing a using directive or an assembly reference?)
[test/dotnet-watch.Tests/Aspire/PipeUtilities.cs]
Re-add the ProjectReference.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the local Mocks/TestLogger.cs copy with a project reference to the shared MSTest utilities project introduced in the Aspire migration PR (dotnet#54722), keeping a single source of truth for the TestLogger implementation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AspireLauncherIntegrationTests exec the Aspire launcher (Microsoft.DotNet.HotReload.Watch.Aspire) as a child process. ExcludeAssets=Runtime omitted the launcher's transitive runtime dependencies (Microsoft.CodeAnalysis*) from the test output, so the launched process crashed at startup with FileNotFoundException and the tests failed with Assert.NotNull. Removing ExcludeAssets=Runtime deploys the full closure next to the launcher. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tionTests) PR dotnet#54766 enabled the Recommended MSTest analyzers as errors; dotnet#54758 merged shortly after with violations that are now build errors, leaving main red and blocking all open migration PRs. Fix the two affected files: - CommandResultAssertions.MSTest.cs: MSTEST0037 (IsTrue(a==b)->AreEqual, IsFalse(a==b) ->AreNotEqual) and MSTEST0023 (IsTrue(!x)->IsFalse(x)). - LocalizeTemplateTests.cs: MSTEST0037 (AreEqual(n, x.Length)->HasCount(n, x)). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 6ac4ef0)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…mstest-mtp-deltaapplier-tests
…DK test env vars to MTP path - TestLogger.BeginScope now returns a no-op scope instead of throwing NotImplementedException. - MTP (dotnet exec) Helix work items now set DOTNET_SDK_TEST_EXECUTION_DIRECTORY (and DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER on Windows) as env-var prefixes, honoring ExcludeAdditionalParameters, matching the dotnet test path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-deltaapplier-tests # Conflicts: # test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Convert the Containers UnitTests and IntegrationTests projects from xUnit.v3 to MSTest.Sdk: - Switch both csproj to MSTest.Sdk and reference Microsoft.NET.TestFramework.MSTest instead of the xUnit-based Microsoft.NET.TestFramework. - Convert [Fact]/[Theory]/[InlineData]/[MemberData] to [TestMethod]/[DataRow]/[DynamicData] and map xUnit asserts to MSTest (including ThrowsExactly, IsGreaterThan, IsNotEmpty, HasCount, AreSequenceEqual, ContainsSingle). - Replace the custom Docker/arch [Fact]/[Theory] discovery attributes with MSTest ConditionBaseAttribute-based gating attributes; convert Skip-bearing usages to [Ignore]. - Replace xUnit collection fixtures with [DoNotParallelize] to preserve serialization, and ITestOutputHelper ctor injection with the SdkTest base class / TestContext. - Flatten TheoryData/params data and add [DoNotParallelize] where data rows shared global state (env vars, static fields, on-disk paths) to account for MSTest method-level parallelism. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR continues the repo-wide xUnit→MSTest migration by moving the Microsoft.NET.Build.Containers unit/integration tests (and related hot-reload delta applier tests) onto MSTest.Sdk, updating assertions/attributes, and porting custom Docker/arch gating to MSTest ConditionBaseAttribute conditions.
Changes:
- Migrates multiple test projects to
MSTest.Sdk, switching project references toMicrosoft.NET.TestFramework.MSTestand adding the requiredMicrosoft.NET.TestFramework.*global<Using>items. - Converts xUnit facts/theories/assertions/fixtures/collections to MSTest
[TestClass]/[TestMethod]/[DataRow]/[DynamicData], plus[DoNotParallelize]where tests mutate process-wide/static state. - Reworks Docker availability/arch gating into MSTest
ConditionBaseAttribute-based attributes and removes obsolete xUnit fixture/collection infrastructure.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.NET.Build.Containers.UnitTests/Resources/ResourceTests.cs | Converts resource tests to MSTest and updates assertions. |
| test/Microsoft.NET.Build.Containers.UnitTests/RegistryTests.cs | Converts registry tests to MSTest, updates asserts, and threads cancellation via TestContext. |
| test/Microsoft.NET.Build.Containers.UnitTests/Microsoft.NET.Build.Containers.UnitTests.csproj | Switches unit test project to MSTest.Sdk and adds TestFramework global usings. |
| test/Microsoft.NET.Build.Containers.UnitTests/ImageIndexGeneratorTests.cs | Converts image index generator tests to MSTest. |
| test/Microsoft.NET.Build.Containers.UnitTests/ImageConfigTests.cs | Converts image config tests to MSTest. |
| test/Microsoft.NET.Build.Containers.UnitTests/ImageBuilderTests.cs | Converts image builder tests to MSTest; uses TestContext for logging. |
| test/Microsoft.NET.Build.Containers.UnitTests/FallbackToHttpMessageHandlerTests.cs | Converts handler tests to MSTest and uses TestContext.CancellationToken. |
| test/Microsoft.NET.Build.Containers.UnitTests/DockerDaemonTests.cs | Replaces xUnit collection with [DoNotParallelize] and migrates to MSTest. |
| test/Microsoft.NET.Build.Containers.UnitTests/DockerAvailableUtils.cs | Replaces xUnit Fact/Theory gating with MSTest condition attributes. |
| test/Microsoft.NET.Build.Containers.UnitTests/DigestUtilsTests.cs | Converts digest tests to MSTest and updates exception/assert APIs. |
| test/Microsoft.NET.Build.Containers.UnitTests/DescriptorTests.cs | Converts descriptor tests to MSTest. |
| test/Microsoft.NET.Build.Containers.UnitTests/CreateNewImageTests.cs | Converts CreateNewImage tests to MSTest using [DataRow]. |
| test/Microsoft.NET.Build.Containers.UnitTests/ContentStoreTests.cs | Converts content store tests to MSTest and updates exception asserts. |
| test/Microsoft.NET.Build.Containers.UnitTests/ContainerHelpersTests.cs | Converts container helper tests to MSTest. |
| test/Microsoft.NET.Build.Containers.UnitTests/AuthHandshakeMessageHandlerTests.cs | Converts auth handshake tests to MSTest and adds [DoNotParallelize] for global/static mutations. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs | Converts targets integration tests to MSTest and reworks data sources for DynamicData. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/RegistryTests.cs | Converts integration registry tests to MSTest and SdkTest. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/ProjectInitializer.cs | Updates assertions for MSTest. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/ParseContainerPropertiesTests.cs | Converts to MSTest and updates assertions (includes one API-usage fix needed). |
| test/Microsoft.NET.Build.Containers.IntegrationTests/PackageTests.cs | Converts packaging sanity tests to MSTest. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/MSBuildCollection.cs | Removes xUnit collection used for serialization. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/Microsoft.NET.Build.Containers.IntegrationTests.csproj | Switches integration test project to MSTest.Sdk and adds TestFramework global usings. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/LayerEndToEndTests.cs | Converts layer E2E tests to MSTest; adds [DoNotParallelize] due to static artifact root. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs | Converts docker E2E tests to MSTest; replaces xUnit output with SdkTest.Log and improves cancellation usage. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/DockerTestsFixture.cs | Removes unused xUnit fixture used for docker infra setup. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/DockerTestsCollection.cs | Removes xUnit docker collection definition. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/DockerSupportsArchHelper.cs | Drops xUnit DataAttribute approach; keeps helper utilities for daemon capability detection. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/DockerRegistryTests.cs | Converts docker registry tests to MSTest/SdkTest and updates command logging. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/DockerIsAvailableAndSupportsArchTheory.cs | Removes xUnit theory gating attribute (replaced by MSTest condition attributes). |
| test/Microsoft.NET.Build.Containers.IntegrationTests/DockerIsAvailableAndSupportsArchFact.cs | Converts docker arch gating to MSTest ConditionBaseAttribute. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/CreateNewImageTests.cs | Converts task integration tests to MSTest/SdkTest. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/CreateImageIndexTests.cs | Converts image index task integration tests to MSTest/SdkTest. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/ArchiveFileRegistryTests.cs | Converts archive registry tests to MSTest and adds [DoNotParallelize] for shared output paths. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/StreamExtensionsTests.cs | Migrates delta applier tests to MSTest and adopts Combinatorial.MSTest. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/StaticAssetUpdateRequestTests.cs | Converts static asset update request tests to MSTest. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/Microsoft.Extensions.DotNetDeltaApplier.Tests.csproj | Switches project to MSTest.Sdk, updates dependencies to MSTest-friendly logging/combinatorial packages. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/ManagedCodeUpdateRequestTests.cs | Converts managed update request tests to MSTest and updates assertion APIs. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/HotReloadClientTests.cs | Converts hot reload client tests to MSTest and replaces xUnit output with TestContext-based logger. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/HotReloadAgentTest.cs | Converts hot reload agent tests to MSTest (including OS-gated test via OSCondition). |
| test/Microsoft.DotNet.Test.MSTest.Utilities/TestLogger.cs | Implements a no-op BeginScope to avoid NotImplementedException in logger scope usage. |
| test/HelixTasks/SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs | Adds clarifying comments about env-var propagation for MTP runs in Helix work items. |
Copilot's findings
- Files reviewed: 41/41 changed files
- Comments generated: 1
Evangelink
enabled auto-merge
June 18, 2026 09:46
The xUnit [DockerAvailableFact/Theory(Skip=...)] and [DockerIsAvailableAndSupportsArch*(Skip=...)] usages carried both an unconditional Skip and a Docker-availability gate. The initial migration collapsed them to [TestMethod]+[Ignore], dropping the Docker condition. Re-add the condition attribute alongside [Ignore] so removing the issue-tracking [Ignore] later restores the original Docker-gated behavior. Also restores the DockerIsAvailableAndSupportsArchTheory condition attribute. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These are MSTest ConditionBaseAttribute conditions, not xUnit [Fact]/[Theory] discovery attributes, so rename them following MSTest's *Condition convention (cf. OSCondition/CICondition) and merge the redundant Fact/Theory variants: - DockerAvailableFactAttribute + DockerAvailableTheoryAttribute -> DockerAvailableConditionAttribute - DockerIsAvailableAndSupportsArchFactAttribute + DockerIsAvailableAndSupportsArchTheoryAttribute -> DockerIsAvailableAndSupportsArchConditionAttribute Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DockerIsAvailableAndSupportsArchConditionAttribute is just the Docker-available (+ containerd) condition plus an architecture check, and both use the same underlying DockerCli detection. Make it inherit from DockerAvailableConditionAttribute (now unsealed) and only run the arch probe when the base condition is met, removing the duplicated availability/containerd logic. The arch check stays in the IntegrationTests project because its helper depends on ContainerCli. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evangelink
commented
Jun 19, 2026
Evangelink
commented
Jun 19, 2026
…DotNetDeltaApplier.Tests The stacked base carried a Combinatorial.MSTest PackageReference which is not available on the dotnet AzDO feeds (NU1101), breaking solution restore. Port the already-reviewed conversion to [DynamicData]/[DataRow] from the deltaapplier branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
JeremyKuhne
approved these changes
Jun 22, 2026
Resolve conflicts in Microsoft.NET.Build.Containers.UnitTests and .IntegrationTests by adopting main's already-merged MSTest migration: main migrated UnitTests to MSTest (Microsoft.DotNet.Test.MSTest.Utilities) and deliberately kept IntegrationTests on xUnit. This PR's competing container migration is superseded, so those directories now match main. The DotNetDeltaApplier.Tests MSTest migration (plus TestLogger/HelixTasks support) remains as the PR's unique change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… build Microsoft.DotNet.Cli.Utils.Tests is an MSTest.Sdk project, but TransientSdkResolutionErrorDetectorTests.cs was added still using xUnit [Fact], so the test build fails with CS0246 'Fact'/'FactAttribute' on main and on every PR built against it (including this one). Add [TestClass] and convert the five [Fact] methods to [TestMethod]; MSTest.Sdk provides the MSTest namespace and FluentAssertions as implicit global usings, so no using changes are needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3 tasks
Member
Author
|
/ba-g #54927 |
YuliiaKovalova
approved these changes
Jun 23, 2026
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.
Migrates the two
Microsoft.NET.Build.Containerstest projects from xUnit.v3 to MSTest.Sdk, continuing the repo-wide xUnit→MSTest migration. These are the first consumers ofMicrosoft.NET.TestFramework.MSTest.Changes
MSTest.Sdk, referencingMicrosoft.NET.TestFramework.MSTestinstead of the xUnit-basedMicrosoft.NET.TestFramework, with the 5Microsoft.NET.TestFramework.*global<Using>items.[Fact]/[Theory]/[InlineData]/[MemberData]→[TestMethod]/[DataRow]/[DynamicData]; xUnit asserts mapped to MSTest, including the analyzer-recommended modern APIs (ThrowsExactly,IsGreaterThan,IsNotEmpty,HasCount,AreSequenceEqual,ContainsSingle, predicateContains).ConditionBaseAttribute-based gating attributes used alongside[TestMethod](class names +LocalRegistrykept for cross-project use);Skip=usages →[TestMethod]+[Ignore]. Removed the obsoleteDataAttribute/collection/fixture files and extractedDockerSupportsArchHelper.[Collection]→[DoNotParallelize](preserves xUnit serialization under MSTest method-level parallelism);ITestOutputHelperctor injection →SdkTestbase (Log/TestContext).[DoNotParallelize]where data rows shared global state (env vars, staticContentStore.ArtifactRoot, on-disk archive paths), and flattened aTheoryData/paramsdata source for MSTest binding.Verification (locally built repo SDK)
TargetsTests108/0,ArchiveFileRegistryTests5/0. Full suite: 167 total, 131 passed, 32 skipped (Docker-gated). The remainingEndToEndMultiArch_*failures are environmental (dotnet new consoleexits 127 in the sandbox; Docker-gated, skip in clean CI).