Skip to content

Migrate Microsoft.NET.Build.Containers test projects to MSTest - #54842

Merged
Evangelink merged 33 commits into
dotnet:mainfrom
Evangelink:evangelink/mstest-containers-tests
Jun 23, 2026
Merged

Evangelink merged 33 commits into
dotnet:mainfrom
Evangelink:evangelink/mstest-containers-tests

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Migrates the two Microsoft.NET.Build.Containers test projects from xUnit.v3 to MSTest.Sdk, continuing the repo-wide xUnit→MSTest migration. These are the first consumers of Microsoft.NET.TestFramework.MSTest.

Changes

  • Project filesMSTest.Sdk, referencing Microsoft.NET.TestFramework.MSTest instead of the xUnit-based Microsoft.NET.TestFramework, with the 5 Microsoft.NET.TestFramework.* global <Using> items.
  • Attributes/asserts[Fact]/[Theory]/[InlineData]/[MemberData][TestMethod]/[DataRow]/[DynamicData]; xUnit asserts mapped to MSTest, including the analyzer-recommended modern APIs (ThrowsExactly, IsGreaterThan, IsNotEmpty, HasCount, AreSequenceEqual, ContainsSingle, predicate Contains).
  • Custom Docker/arch attributes → rewritten as ConditionBaseAttribute-based gating attributes used alongside [TestMethod] (class names + LocalRegistry kept for cross-project use); Skip= usages → [TestMethod] + [Ignore]. Removed the obsolete DataAttribute/collection/fixture files and extracted DockerSupportsArchHelper.
  • Fixtures & output[Collection][DoNotParallelize] (preserves xUnit serialization under MSTest method-level parallelism); ITestOutputHelper ctor injection → SdkTest base (Log / TestContext).
  • Parallelism hardening → added [DoNotParallelize] where data rows shared global state (env vars, static ContentStore.ArtifactRoot, on-disk archive paths), and flattened a TheoryData/params data source for MSTest binding.

Verification (locally built repo SDK)

  • UnitTests: clean build — 269 tests, 263 passed, 6 skipped, 0 failed.
  • IntegrationTests: clean build, confirmed running under the MSTest MTP runner; TargetsTests 108/0, ArchiveFileRegistryTests 5/0. Full suite: 167 total, 131 passed, 32 skipped (Docker-gated). The remaining EndToEndMultiArch_* failures are environmental (dotnet new console exits 127 in the sandbox; Docker-gated, skip in clean CI).

Evangelink and others added 23 commits June 12, 2026 18:03
…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>
…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>
Copilot AI review requested due to automatic review settings June 18, 2026 09:39
@Evangelink
Evangelink requested a review from a team as a code owner June 18, 2026 09:39

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 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 to Microsoft.NET.TestFramework.MSTest and adding the required Microsoft.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
Evangelink enabled auto-merge June 18, 2026 09:46
Evangelink and others added 2 commits June 18, 2026 13:24
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>
Comment thread test/Microsoft.NET.Build.Containers.UnitTests/RegistryTests.cs Outdated
Evangelink and others added 2 commits June 19, 2026 15:45
…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>
Evangelink and others added 2 commits June 22, 2026 18:30
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>
@Evangelink

Copy link
Copy Markdown
Member Author

/ba-g #54927

@Evangelink
Evangelink merged commit 55be1b0 into dotnet:main Jun 23, 2026
23 of 25 checks passed
@Evangelink
Evangelink deleted the evangelink/mstest-containers-tests branch June 23, 2026 09:39
@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.

5 participants