Fix StartsWithPortableAndBootstraperExe (#8219)

This commit is contained in:
Justin Kotalik 2019-03-06 11:59:42 -08:00 committed by GitHub
parent a1ec03e1e6
commit 02dbe55466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 11 deletions

View File

@ -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);

View File

@ -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")));

View File

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

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\build\testsite.props" />
@ -8,11 +8,9 @@
</PropertyGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<!-- UseAppHost is a workaround for https://github.com/aspnet/websdk/issues/422 -->
<TestAssetPublishProfile Include="Portable" Properties="UseAppHost=false;TargetFramework=netcoreapp3.0" />
<TestAssetPublishProfile Include="Portable" Properties="TargetFramework=netcoreapp3.0" />
<TestAssetPublishProfile Include="Standalone-x64" Properties="RuntimeIdentifier=win-x64;" />
<TestAssetPublishProfile Include="Standalone-x86" Properties="RuntimeIdentifier=win-x86;" />
<TestAssetPublishProfile Include="AppHost" Properties="RuntimeIdentifier=win-x64;UseAppHost=true;SelfContained=false;" />
</ItemGroup>
<ItemGroup>