From 02dbe554669bfaec9ca7f477fb62956baa35f28d Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Wed, 6 Mar 2019 11:59:42 -0800 Subject: [PATCH] Fix StartsWithPortableAndBootstraperExe (#8219) --- .../src/Common/DotNetCommands.cs | 8 +++++++- .../test/Common.FunctionalTests/Inprocess/StartupTests.cs | 7 ++++--- .../InProcessWebSite.csproj | 4 +--- .../testassets/InProcessWebSite/InProcessWebSite.csproj | 6 ++---- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Hosting/Server.IntegrationTesting/src/Common/DotNetCommands.cs b/src/Hosting/Server.IntegrationTesting/src/Common/DotNetCommands.cs index e30e9defc5..5533834014 100644 --- a/src/Hosting/Server.IntegrationTesting/src/Common/DotNetCommands.cs +++ b/src/Hosting/Server.IntegrationTesting/src/Common/DotNetCommands.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -17,6 +17,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting public static string GetDotNetHome() { var dotnetHome = Environment.GetEnvironmentVariable("DOTNET_HOME"); + var dotnetRoot = Environment.GetEnvironmentVariable("DOTNET_ROOT"); var userProfile = Environment.GetEnvironmentVariable("USERPROFILE"); var home = Environment.GetEnvironmentVariable("HOME"); @@ -25,6 +26,11 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting { result = dotnetHome; } + else if (!string.IsNullOrEmpty(dotnetRoot)) + { + // DOTNET_ROOT has x64 appended to the path, which we append again in GetDotNetInstallDir + result = dotnetRoot.Substring(0, dotnetRoot.Length - 3); + } else if (!string.IsNullOrEmpty(userProfile)) { result = Path.Combine(userProfile, _dotnetFolderName); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs index f3507ecf99..78eef04c73 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs @@ -108,7 +108,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe"))); } - [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7972 [ConditionalTheory] [InlineData(RuntimeArchitecture.x64)] @@ -186,16 +185,18 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests await StartAsync(deploymentParameters); } - [SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7972 [ConditionalFact] [RequiresIIS(IISCapability.PoolEnvironmentVariables)] public async Task StartsWithPortableAndBootstraperExe() { var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite); + deploymentParameters.TransformPath((path, root) => "InProcessWebSite.exe"); + deploymentParameters.TransformArguments((arguments, root) => ""); + // We need the right dotnet on the path in IIS deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture)); + // ReferenceTestTasks is workaround for https://github.com/dotnet/sdk/issues/2482 - deploymentParameters.AdditionalPublishParameters = "AppHost"; var deploymentResult = await DeployAsync(deploymentParameters); Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe"))); diff --git a/src/Servers/IIS/IIS/test/testassets/InProcessForwardsCompatWebSite/InProcessWebSite.csproj b/src/Servers/IIS/IIS/test/testassets/InProcessForwardsCompatWebSite/InProcessWebSite.csproj index 6e148d2245..233c678ae4 100644 --- a/src/Servers/IIS/IIS/test/testassets/InProcessForwardsCompatWebSite/InProcessWebSite.csproj +++ b/src/Servers/IIS/IIS/test/testassets/InProcessForwardsCompatWebSite/InProcessWebSite.csproj @@ -8,11 +8,9 @@ - - + - diff --git a/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/InProcessWebSite.csproj b/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/InProcessWebSite.csproj index 877307c1b0..2e364ba379 100644 --- a/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/InProcessWebSite.csproj +++ b/src/Servers/IIS/IIS/test/testassets/InProcessWebSite/InProcessWebSite.csproj @@ -1,4 +1,4 @@ - + @@ -8,11 +8,9 @@ - - + -