Skip to content

Commit 02dbe55

Browse files
authored
Fix StartsWithPortableAndBootstraperExe (#8219)
1 parent a1ec03e commit 02dbe55

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

src/Hosting/Server.IntegrationTesting/src/Common/DotNetCommands.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
@@ -17,6 +17,7 @@ public static class DotNetCommands
1717
public static string GetDotNetHome()
1818
{
1919
var dotnetHome = Environment.GetEnvironmentVariable("DOTNET_HOME");
20+
var dotnetRoot = Environment.GetEnvironmentVariable("DOTNET_ROOT");
2021
var userProfile = Environment.GetEnvironmentVariable("USERPROFILE");
2122
var home = Environment.GetEnvironmentVariable("HOME");
2223

@@ -25,6 +26,11 @@ public static string GetDotNetHome()
2526
{
2627
result = dotnetHome;
2728
}
29+
else if (!string.IsNullOrEmpty(dotnetRoot))
30+
{
31+
// DOTNET_ROOT has x64 appended to the path, which we append again in GetDotNetInstallDir
32+
result = dotnetRoot.Substring(0, dotnetRoot.Length - 3);
33+
}
2834
else if (!string.IsNullOrEmpty(userProfile))
2935
{
3036
result = Path.Combine(userProfile, _dotnetFolderName);

src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public async Task StartsWithDotnetOnThePath(string path)
108108
Assert.Equal(1, TestSink.Writes.Count(w => w.Message.Contains("Invoking where.exe to find dotnet.exe")));
109109
}
110110

111-
112111
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7972
113112
[ConditionalTheory]
114113
[InlineData(RuntimeArchitecture.x64)]
@@ -186,16 +185,18 @@ public async Task HelloWorld(TestVariant variant)
186185
await StartAsync(deploymentParameters);
187186
}
188187

189-
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7972
190188
[ConditionalFact]
191189
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
192190
public async Task StartsWithPortableAndBootstraperExe()
193191
{
194192
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
193+
deploymentParameters.TransformPath((path, root) => "InProcessWebSite.exe");
194+
deploymentParameters.TransformArguments((arguments, root) => "");
195+
195196
// We need the right dotnet on the path in IIS
196197
deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
198+
197199
// ReferenceTestTasks is workaround for https://github.com/dotnet/sdk/issues/2482
198-
deploymentParameters.AdditionalPublishParameters = "AppHost";
199200
var deploymentResult = await DeployAsync(deploymentParameters);
200201

201202
Assert.True(File.Exists(Path.Combine(deploymentResult.ContentRoot, "InProcessWebSite.exe")));

src/Servers/IIS/IIS/test/testassets/InProcessForwardsCompatWebSite/InProcessWebSite.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
</PropertyGroup>
99

1010
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
11-
<!-- UseAppHost is a workaround for https://github.com/aspnet/websdk/issues/422 -->
12-
<TestAssetPublishProfile Include="Portable" Properties="UseAppHost=false;TargetFramework=netcoreapp3.0" />
11+
<TestAssetPublishProfile Include="Portable" Properties="TargetFramework=netcoreapp3.0" />
1312
<TestAssetPublishProfile Include="Standalone-x64" Properties="RuntimeIdentifier=win-x64;" />
1413
<TestAssetPublishProfile Include="Standalone-x86" Properties="RuntimeIdentifier=win-x86;" />
15-
<TestAssetPublishProfile Include="AppHost" Properties="RuntimeIdentifier=win-x64;UseAppHost=true;SelfContained=false;" />
1614
</ItemGroup>
1715

1816
<ItemGroup>

src/Servers/IIS/IIS/test/testassets/InProcessWebSite/InProcessWebSite.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<Import Project="..\..\..\..\build\testsite.props" />
44

@@ -8,11 +8,9 @@
88
</PropertyGroup>
99

1010
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
11-
<!-- UseAppHost is a workaround for https://github.com/aspnet/websdk/issues/422 -->
12-
<TestAssetPublishProfile Include="Portable" Properties="UseAppHost=false;TargetFramework=netcoreapp3.0" />
11+
<TestAssetPublishProfile Include="Portable" Properties="TargetFramework=netcoreapp3.0" />
1312
<TestAssetPublishProfile Include="Standalone-x64" Properties="RuntimeIdentifier=win-x64;" />
1413
<TestAssetPublishProfile Include="Standalone-x86" Properties="RuntimeIdentifier=win-x86;" />
15-
<TestAssetPublishProfile Include="AppHost" Properties="RuntimeIdentifier=win-x64;UseAppHost=true;SelfContained=false;" />
1614
</ItemGroup>
1715

1816
<ItemGroup>

0 commit comments

Comments
 (0)