From e692d9ed8abcb7cd4e7bfdaacf51067de4421325 Mon Sep 17 00:00:00 2001 From: Jakub Jares Date: Tue, 18 Aug 2026 10:23:25 +0200 Subject: [PATCH] Fix apphost DOTNET_ROOT path assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compare Windows path values without drive-letter casing sensitivity. 🤖 --- .../MSBuildTests.Test.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs index df12306aae..e4898b2a84 100644 --- a/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs +++ b/test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/MSBuildTests.Test.cs @@ -399,7 +399,17 @@ public async Task InvokeTestingPlatform_Target_Should_Set_DotnetRoot_For_AppHost environmentVariables: CreateEnvironmentVariables(), cancellationToken: TestContext.CancellationToken); - derivedResult.AssertOutputContains($"[env] {dotnetRootVariableName}={dotnetRoot}"); + string dotnetRootOutputPrefix = $"[env] {dotnetRootVariableName}="; + string? dotnetRootOutput = derivedResult.StandardOutputLines + .Select(line => line.TrimStart()) + .FirstOrDefault(line => line.StartsWith(dotnetRootOutputPrefix, StringComparison.Ordinal)); + Assert.IsNotNull(dotnetRootOutput, derivedResult.ToString()); + // DOTNET_HOST_PATH can preserve different drive-letter casing than RootFinder on Windows. + Assert.AreEqual( + dotnetRoot, + dotnetRootOutput[dotnetRootOutputPrefix.Length..], + ignoreCase: OperatingSystem.IsWindows(), + derivedResult.ToString()); DotnetMuxerResult explicitResult = await DotnetCli.RunAsync( $"build -t:Test -p:TestingPlatformCaptureOutput=False -p:ExplicitDotnetRoot=\"{dotnetRoot}\" \"{testAsset.TargetAssetPath}\"",