Allow test projects to run standalone (#7144)
This commit is contained in:
parent
d53f0da021
commit
35746adf68
|
|
@ -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.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -45,19 +45,22 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
DeploymentParameters.RuntimeFlavor = GetRuntimeFlavor(DeploymentParameters.TargetFramework);
|
DeploymentParameters.RuntimeFlavor = GetRuntimeFlavor(DeploymentParameters.TargetFramework);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(DeploymentParameters.ApplicationPath))
|
if (DeploymentParameters.ApplicationPublisher == null)
|
||||||
{
|
{
|
||||||
throw new ArgumentException("ApplicationPath cannot be null.");
|
if (string.IsNullOrEmpty(DeploymentParameters.ApplicationPath))
|
||||||
}
|
{
|
||||||
|
throw new ArgumentException("ApplicationPath cannot be null.");
|
||||||
|
}
|
||||||
|
|
||||||
if (!Directory.Exists(DeploymentParameters.ApplicationPath))
|
if (!Directory.Exists(DeploymentParameters.ApplicationPath))
|
||||||
{
|
{
|
||||||
throw new DirectoryNotFoundException(string.Format("Application path {0} does not exist.", DeploymentParameters.ApplicationPath));
|
throw new DirectoryNotFoundException(string.Format("Application path {0} does not exist.", DeploymentParameters.ApplicationPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(DeploymentParameters.ApplicationName))
|
if (string.IsNullOrEmpty(DeploymentParameters.ApplicationName))
|
||||||
{
|
{
|
||||||
DeploymentParameters.ApplicationName = new DirectoryInfo(DeploymentParameters.ApplicationPath).Name;
|
DeploymentParameters.ApplicationName = new DirectoryInfo(DeploymentParameters.ApplicationPath).Name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,7 +100,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_publishedApplication.Dispose();
|
_publishedApplication?.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
[InlineData(HostingModel.OutOfProcess, 502, "502.5")]
|
[InlineData(HostingModel.OutOfProcess, 502, "502.5")]
|
||||||
public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed(HostingModel hostingModel, int statusCode, string content)
|
public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed(HostingModel hostingModel, int statusCode, string content)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel: hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel: hostingModel);
|
||||||
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", "nonexistent"));
|
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", "nonexistent"));
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -228,7 +228,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
|
||||||
|
|
||||||
private async Task<IISDeploymentResult> DeployApp(HostingModel hostingModel = HostingModel.InProcess)
|
private async Task<IISDeploymentResult> DeployApp(HostingModel hostingModel = HostingModel.InProcess)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel: hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel: hostingModel);
|
||||||
|
|
||||||
return await DeployAsync(deploymentParameters);
|
return await DeployAsync(deploymentParameters);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
var username = Environment.GetEnvironmentVariable("ASPNETCORE_MODULE_TEST_USER");
|
var username = Environment.GetEnvironmentVariable("ASPNETCORE_MODULE_TEST_USER");
|
||||||
var password = Environment.GetEnvironmentVariable("ASPNETCORE_MODULE_TEST_PASSWORD");
|
var password = Environment.GetEnvironmentVariable("ASPNETCORE_MODULE_TEST_PASSWORD");
|
||||||
|
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.SetAnonymousAuth(enabled: false);
|
deploymentParameters.SetAnonymousAuth(enabled: false);
|
||||||
deploymentParameters.SetWindowsAuth(enabled: false);
|
deploymentParameters.SetWindowsAuth(enabled: false);
|
||||||
deploymentParameters.SetBasicAuth(enabled: true);
|
deploymentParameters.SetBasicAuth(enabled: true);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[MemberData(nameof(TestVariants))]
|
[MemberData(nameof(TestVariants))]
|
||||||
public async Task StartupStress(TestVariant variant)
|
public async Task StartupStress(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task ConfigurationChangeStopsInProcess()
|
public async Task ConfigurationChangeStopsInProcess()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.InProcess, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.InProcess);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task ConfigurationChangeForcesChildProcessRestart()
|
public async Task ConfigurationChangeForcesChildProcessRestart()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -63,7 +63,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task OutOfProcessToInProcessHostingModelSwitchWorks()
|
public async Task OutOfProcessToInProcessHostingModelSwitchWorks()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[InlineData(HostingModel.OutOfProcess)]
|
[InlineData(HostingModel.OutOfProcess)]
|
||||||
public async Task ConfigurationTouchedStress(HostingModel hostingModel)
|
public async Task ConfigurationTouchedStress(HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentResult = await DeployAsync(_fixture.GetBaseDeploymentParameters(hostingModel, publish: true));
|
var deploymentResult = await DeployAsync(_fixture.GetBaseDeploymentParameters(hostingModel));
|
||||||
|
|
||||||
await deploymentResult.AssertStarts();
|
await deploymentResult.AssertStarts();
|
||||||
var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => {
|
var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => {
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
var appName = "\u041C\u043E\u0451\u041F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435";
|
var appName = "\u041C\u043E\u0451\u041F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435";
|
||||||
|
|
||||||
var port = TestPortHelper.GetNextSSLPort();
|
var port = TestPortHelper.GetNextSSLPort();
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.InProcess, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.InProcess);
|
||||||
deploymentParameters.ApplicationBaseUriHint = $"https://localhost:{port}/";
|
deploymentParameters.ApplicationBaseUriHint = $"https://localhost:{port}/";
|
||||||
deploymentParameters.AddHttpsToServerConfig();
|
deploymentParameters.AddHttpsToServerConfig();
|
||||||
deploymentParameters.AddServerConfigAction(
|
deploymentParameters.AddServerConfigAction(
|
||||||
|
|
@ -100,7 +100,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresNewShim]
|
[RequiresNewShim]
|
||||||
public async Task HttpsPortCanBeOverriden()
|
public async Task HttpsPortCanBeOverriden()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);
|
||||||
|
|
||||||
deploymentParameters.AddServerConfigAction(
|
deploymentParameters.AddServerConfigAction(
|
||||||
element => {
|
element => {
|
||||||
|
|
@ -126,7 +126,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
var sslPort = GetNextSSLPort();
|
var sslPort = GetNextSSLPort();
|
||||||
var anotherSslPort = GetNextSSLPort(sslPort);
|
var anotherSslPort = GetNextSSLPort(sslPort);
|
||||||
|
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);
|
||||||
|
|
||||||
deploymentParameters.AddServerConfigAction(
|
deploymentParameters.AddServerConfigAction(
|
||||||
element => {
|
element => {
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
"AReallyLongValueThatIsGreaterThan300CharactersToForceResizeInNative";
|
"AReallyLongValueThatIsGreaterThan300CharactersToForceResizeInNative";
|
||||||
|
|
||||||
|
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_TESTING_LONG_VALUE"] = expectedValue;
|
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_INPROCESS_TESTING_LONG_VALUE"] = expectedValue;
|
||||||
|
|
||||||
Assert.Equal(
|
Assert.Equal(
|
||||||
|
|
@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private async Task AuthHeaderEnvironmentVariableRemoved(HostingModel hostingModel)
|
private async Task AuthHeaderEnvironmentVariableRemoved(HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_IIS_HTTPAUTH"] = "shouldberemoved";
|
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_IIS_HTTPAUTH"] = "shouldberemoved";
|
||||||
|
|
||||||
Assert.DoesNotContain("shouldberemoved", await GetStringAsync(deploymentParameters,"/GetEnvironmentVariable?name=ASPNETCORE_IIS_HTTPAUTH"));
|
Assert.DoesNotContain("shouldberemoved", await GetStringAsync(deploymentParameters,"/GetEnvironmentVariable?name=ASPNETCORE_IIS_HTTPAUTH"));
|
||||||
|
|
@ -67,7 +67,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private async Task WebConfigOverridesGlobalEnvironmentVariables(HostingModel hostingModel)
|
private async Task WebConfigOverridesGlobalEnvironmentVariables(HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
deploymentParameters.EnvironmentVariables["ASPNETCORE_ENVIRONMENT"] = "Development";
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_ENVIRONMENT"] = "Development";
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_ENVIRONMENT"] = "Production";
|
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_ENVIRONMENT"] = "Production";
|
||||||
Assert.Equal("Production", await GetStringAsync(deploymentParameters, "/GetEnvironmentVariable?name=ASPNETCORE_ENVIRONMENT"));
|
Assert.Equal("Production", await GetStringAsync(deploymentParameters, "/GetEnvironmentVariable?name=ASPNETCORE_ENVIRONMENT"));
|
||||||
|
|
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private async Task WebConfigAppendsHostingStartup(HostingModel hostingModel)
|
private async Task WebConfigAppendsHostingStartup(HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
deploymentParameters.EnvironmentVariables["ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"] = "Asm1";
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"] = "Asm1";
|
||||||
if (hostingModel == HostingModel.InProcess)
|
if (hostingModel == HostingModel.InProcess)
|
||||||
{
|
{
|
||||||
|
|
@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private async Task WebConfigOverridesHostingStartup(HostingModel hostingModel)
|
private async Task WebConfigOverridesHostingStartup(HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
deploymentParameters.EnvironmentVariables["ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"] = "Asm1";
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"] = "Asm1";
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"] = "Asm2";
|
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"] = "Asm2";
|
||||||
Assert.Equal("Asm2", await GetStringAsync(deploymentParameters, "/GetEnvironmentVariable?name=ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"));
|
Assert.Equal("Asm2", await GetStringAsync(deploymentParameters, "/GetEnvironmentVariable?name=ASPNETCORE_HOSTINGSTARTUPASSEMBLIES"));
|
||||||
|
|
@ -124,7 +124,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private async Task WebConfigExpandsVariables(HostingModel hostingModel)
|
private async Task WebConfigExpandsVariables(HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
deploymentParameters.EnvironmentVariables["TestVariable"] = "World";
|
deploymentParameters.EnvironmentVariables["TestVariable"] = "World";
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["OtherVariable"] = "%TestVariable%;Hello";
|
deploymentParameters.WebConfigBasedEnvironmentVariables["OtherVariable"] = "%TestVariable%;Hello";
|
||||||
Assert.Equal("World;Hello", await GetStringAsync(deploymentParameters, "/GetEnvironmentVariable?name=OtherVariable"));
|
Assert.Equal("World;Hello", await GetStringAsync(deploymentParameters, "/GetEnvironmentVariable?name=OtherVariable"));
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task IncludesAdditionalErrorPageTextInProcessHandlerLoadFailure_CorrectString()
|
public async Task IncludesAdditionalErrorPageTextInProcessHandlerLoadFailure_CorrectString()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var response = await DeployAppWithStartupFailure(deploymentParameters);
|
var response = await DeployAppWithStartupFailure(deploymentParameters);
|
||||||
|
|
||||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
||||||
|
|
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task IncludesAdditionalErrorPageTextOutOfProcessStartupFailure_CorrectString()
|
public async Task IncludesAdditionalErrorPageTextOutOfProcessStartupFailure_CorrectString()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);
|
||||||
var response = await DeployAppWithStartupFailure(deploymentParameters);
|
var response = await DeployAppWithStartupFailure(deploymentParameters);
|
||||||
|
|
||||||
Assert.Equal(HttpStatusCode.BadGateway, response.StatusCode);
|
Assert.Equal(HttpStatusCode.BadGateway, response.StatusCode);
|
||||||
|
|
@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task IncludesAdditionalErrorPageTextOutOfProcessHandlerLoadFailure_CorrectString()
|
public async Task IncludesAdditionalErrorPageTextOutOfProcessHandlerLoadFailure_CorrectString()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);
|
||||||
deploymentParameters.HandlerSettings["handlerVersion"] = "88.93";
|
deploymentParameters.HandlerSettings["handlerVersion"] = "88.93";
|
||||||
deploymentParameters.EnvironmentVariables["ANCM_ADDITIONAL_ERROR_PAGE_LINK"] = "http://example";
|
deploymentParameters.EnvironmentVariables["ANCM_ADDITIONAL_ERROR_PAGE_LINK"] = "http://example";
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresNewHandler]
|
[RequiresNewHandler]
|
||||||
public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_CorrectString()
|
public async Task IncludesAdditionalErrorPageTextInProcessStartupFailure_CorrectString()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} EarlyReturn");
|
deploymentParameters.TransformArguments((a, _) => $"{a} EarlyReturn");
|
||||||
deploymentParameters.EnvironmentVariables["ANCM_ADDITIONAL_ERROR_PAGE_LINK"] = "http://example";
|
deploymentParameters.EnvironmentVariables["ANCM_ADDITIONAL_ERROR_PAGE_LINK"] = "http://example";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task CheckStartupEventLogMessage()
|
public async Task CheckStartupEventLogMessage()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
await deploymentResult.AssertStarts();
|
await deploymentResult.AssertStarts();
|
||||||
|
|
@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task CheckShutdownEventLogMessage()
|
public async Task CheckShutdownEventLogMessage()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
await deploymentResult.AssertStarts();
|
await deploymentResult.AssertStarts();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.FailedRequestTracingModule)]
|
[RequiresIIS(IISCapability.FailedRequestTracingModule)]
|
||||||
public async Task FrebIncludesHResultFailures()
|
public async Task FrebIncludesHResultFailures()
|
||||||
{
|
{
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters();
|
||||||
parameters.TransformArguments((args, _) => string.Empty);
|
parameters.TransformArguments((args, _) => string.Empty);
|
||||||
var result = await SetupFrebApp(parameters);
|
var result = await SetupFrebApp(parameters);
|
||||||
|
|
||||||
|
|
@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private async Task<IISDeploymentResult> SetupFrebApp(IISDeploymentParameters parameters = null)
|
private async Task<IISDeploymentResult> SetupFrebApp(IISDeploymentParameters parameters = null)
|
||||||
{
|
{
|
||||||
parameters = parameters ?? _fixture.GetBaseDeploymentParameters(publish: true);
|
parameters = parameters ?? _fixture.GetBaseDeploymentParameters();
|
||||||
parameters.EnableFreb("Verbose", _logFolderPath);
|
parameters.EnableFreb("Verbose", _logFolderPath);
|
||||||
|
|
||||||
Directory.CreateDirectory(_logFolderPath);
|
Directory.CreateDirectory(_logFolderPath);
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ using Xunit;
|
||||||
namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
[Collection(IISTestSiteCollection.Name)]
|
[Collection(IISTestSiteCollection.Name)]
|
||||||
public class HelloWorldInProcessTests
|
public class HelloWorldInProcessTests: FixtureLoggedTest
|
||||||
{
|
{
|
||||||
private readonly IISTestSiteFixture _fixture;
|
private readonly IISTestSiteFixture _fixture;
|
||||||
|
|
||||||
public HelloWorldInProcessTests(IISTestSiteFixture fixture)
|
public HelloWorldInProcessTests(IISTestSiteFixture fixture) : base(fixture)
|
||||||
{
|
{
|
||||||
_fixture = fixture;
|
_fixture = fixture;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[InlineData("ConsoleWrite")]
|
[InlineData("ConsoleWrite")]
|
||||||
public async Task CheckStdoutLoggingToPipe_DoesNotCrashProcess(string path)
|
public async Task CheckStdoutLoggingToPipe_DoesNotCrashProcess(string path)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
await Helpers.AssertStarts(deploymentResult, path);
|
await Helpers.AssertStarts(deploymentResult, path);
|
||||||
|
|
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[InlineData("ConsoleWriteStartServer")]
|
[InlineData("ConsoleWriteStartServer")]
|
||||||
public async Task CheckStdoutLoggingToPipeWithFirstWrite(string path)
|
public async Task CheckStdoutLoggingToPipeWithFirstWrite(string path)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
|
|
||||||
var firstWriteString = "TEST MESSAGE";
|
var firstWriteString = "TEST MESSAGE";
|
||||||
|
|
||||||
|
|
@ -67,7 +67,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public async Task CheckUnicodePipe()
|
public async Task CheckUnicodePipe()
|
||||||
{
|
{
|
||||||
var path = "CheckConsoleFunctions";
|
var path = "CheckConsoleFunctions";
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task ShutdownTimeoutIsApplied()
|
public async Task ShutdownTimeoutIsApplied()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} HangOnStop");
|
deploymentParameters.TransformArguments((a, _) => $"{a} HangOnStop");
|
||||||
deploymentParameters.WebConfigActionList.Add(
|
deploymentParameters.WebConfigActionList.Add(
|
||||||
WebConfigHelpers.AddOrModifyAspNetCoreSection("shutdownTimeLimit", "1"));
|
WebConfigHelpers.AddOrModifyAspNetCoreSection("shutdownTimeLimit", "1"));
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
// Canceled token doesn't affect shutdown, in-proc doesn't handle ungraceful shutdown
|
// Canceled token doesn't affect shutdown, in-proc doesn't handle ungraceful shutdown
|
||||||
// IIS's ShutdownTimeLimit will handle that.
|
// IIS's ShutdownTimeLimit will handle that.
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var deploymentResult = await DeployAsync(parameters);
|
var deploymentResult = await DeployAsync(parameters);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[InlineData("CheckOversizedStdOutWrites")]
|
[InlineData("CheckOversizedStdOutWrites")]
|
||||||
public async Task CheckStdoutWithLargeWrites_TestSink(string mode)
|
public async Task CheckStdoutWithLargeWrites_TestSink(string mode)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {mode}");
|
deploymentParameters.TransformArguments((a, _) => $"{a} {mode}");
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[InlineData("CheckOversizedStdOutWrites")]
|
[InlineData("CheckOversizedStdOutWrites")]
|
||||||
public async Task CheckStdoutWithLargeWrites_LogFile(string mode)
|
public async Task CheckStdoutWithLargeWrites_LogFile(string mode)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {mode}");
|
deploymentParameters.TransformArguments((a, _) => $"{a} {mode}");
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task CheckValidConsoleFunctions()
|
public async Task CheckValidConsoleFunctions()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} CheckConsoleFunctions");
|
deploymentParameters.TransformArguments((a, _) => $"{a} CheckConsoleFunctions");
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task Gets500_30_ErrorPage()
|
public async Task Gets500_30_ErrorPage()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} EarlyReturn");
|
deploymentParameters.TransformArguments((a, _) => $"{a} EarlyReturn");
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public async Task ExpandEnvironmentVariableInWebConfig()
|
public async Task ExpandEnvironmentVariableInWebConfig()
|
||||||
{
|
{
|
||||||
// Point to dotnet installed in user profile.
|
// Point to dotnet installed in user profile.
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
deploymentParameters.EnvironmentVariables["DotnetPath"] = _dotnetLocation;
|
deploymentParameters.EnvironmentVariables["DotnetPath"] = _dotnetLocation;
|
||||||
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", "%DotnetPath%"));
|
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", "%DotnetPath%"));
|
||||||
await StartAsync(deploymentParameters);
|
await StartAsync(deploymentParameters);
|
||||||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[InlineData("dotnet.zip", "", @"Process path 'dotnet.zip' doesn't have '.exe' extension.")]
|
[InlineData("dotnet.zip", "", @"Process path 'dotnet.zip' doesn't have '.exe' extension.")]
|
||||||
public async Task InvalidProcessPath_ExpectServerError(string path, string arguments, string subError)
|
public async Task InvalidProcessPath_ExpectServerError(string path, string arguments, string subError)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", path));
|
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", path));
|
||||||
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("arguments", arguments));
|
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("arguments", arguments));
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task StartsWithDotnetLocationWithoutExe()
|
public async Task StartsWithDotnetLocationWithoutExe()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
|
|
||||||
var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf("."));
|
var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf("."));
|
||||||
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", dotnetLocationWithoutExtension));
|
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", dotnetLocationWithoutExtension));
|
||||||
|
|
@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task StartsWithDotnetLocationUppercase()
|
public async Task StartsWithDotnetLocationUppercase()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
|
|
||||||
var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".")).ToUpperInvariant();
|
var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".")).ToUpperInvariant();
|
||||||
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", dotnetLocationWithoutExtension));
|
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", dotnetLocationWithoutExtension));
|
||||||
|
|
@ -94,7 +94,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task StartsWithDotnetOnThePath(string path)
|
public async Task StartsWithDotnetOnThePath(string path)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
|
|
||||||
deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation);
|
deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(_dotnetLocation);
|
||||||
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", path));
|
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", path));
|
||||||
|
|
@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task StartsWithDotnetInstallLocation(RuntimeArchitecture runtimeArchitecture)
|
public async Task StartsWithDotnetInstallLocation(RuntimeArchitecture runtimeArchitecture)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
deploymentParameters.RuntimeArchitecture = runtimeArchitecture;
|
deploymentParameters.RuntimeArchitecture = runtimeArchitecture;
|
||||||
|
|
||||||
// IIS doesn't allow empty PATH
|
// IIS doesn't allow empty PATH
|
||||||
|
|
@ -147,7 +147,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task DoesNotStartIfDisabled()
|
public async Task DoesNotStartIfDisabled()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
|
|
||||||
using (new TestRegistryKey(
|
using (new TestRegistryKey(
|
||||||
Registry.LocalMachine,
|
Registry.LocalMachine,
|
||||||
|
|
@ -179,7 +179,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[MemberData(nameof(TestVariants))]
|
[MemberData(nameof(TestVariants))]
|
||||||
public async Task HelloWorld(TestVariant variant)
|
public async Task HelloWorld(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
await StartAsync(deploymentParameters);
|
await StartAsync(deploymentParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -187,7 +187,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
[RequiresIIS(IISCapability.PoolEnvironmentVariables)]
|
||||||
public async Task StartsWithPortableAndBootstraperExe()
|
public async Task StartsWithPortableAndBootstraperExe()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
// We need the right dotnet on the path in IIS
|
// We need the right dotnet on the path in IIS
|
||||||
deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
|
deploymentParameters.EnvironmentVariables["PATH"] = Path.GetDirectoryName(DotNetCommands.GetDotNetExecutable(deploymentParameters.RuntimeArchitecture));
|
||||||
// ReferenceTestTasks is workaround for https://github.com/dotnet/sdk/issues/2482
|
// ReferenceTestTasks is workaround for https://github.com/dotnet/sdk/issues/2482
|
||||||
|
|
@ -204,7 +204,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task DetectsOverriddenServer()
|
public async Task DetectsOverriddenServer()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} OverriddenServer");
|
deploymentParameters.TransformArguments((a, _) => $"{a} OverriddenServer");
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -221,7 +221,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task LogsStartupExceptionExitError()
|
public async Task LogsStartupExceptionExitError()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} Throw");
|
deploymentParameters.TransformArguments((a, _) => $"{a} Throw");
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -239,7 +239,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task LogsUnexpectedThreadExitError()
|
public async Task LogsUnexpectedThreadExitError()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} EarlyReturn");
|
deploymentParameters.TransformArguments((a, _) => $"{a} EarlyReturn");
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -256,7 +256,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent()
|
public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.ApplicationType = ApplicationType.Standalone;
|
deploymentParameters.ApplicationType = ApplicationType.Standalone;
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -273,7 +273,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresNewShim]
|
[RequiresNewShim]
|
||||||
public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure()
|
public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.ApplicationType = ApplicationType.Standalone;
|
deploymentParameters.ApplicationType = ApplicationType.Standalone;
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -287,7 +287,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependencies()
|
public async Task TargedDifferenceSharedFramework_FailedToFindNativeDependencies()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
Helpers.ModifyFrameworkVersionInRuntimeConfig(deploymentResult);
|
Helpers.ModifyFrameworkVersionInRuntimeConfig(deploymentResult);
|
||||||
|
|
@ -299,7 +299,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task RemoveInProcessReference_FailedToFindRequestHandler()
|
public async Task RemoveInProcessReference_FailedToFindRequestHandler()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.ApplicationType = ApplicationType.Standalone;
|
deploymentParameters.ApplicationType = ApplicationType.Standalone;
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -320,7 +320,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task StartupTimeoutIsApplied()
|
public async Task StartupTimeoutIsApplied()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} Hang");
|
deploymentParameters.TransformArguments((a, _) => $"{a} Hang");
|
||||||
deploymentParameters.WebConfigActionList.Add(
|
deploymentParameters.WebConfigActionList.Add(
|
||||||
WebConfigHelpers.AddOrModifyAspNetCoreSection("startupTimeLimit", "1"));
|
WebConfigHelpers.AddOrModifyAspNetCoreSection("startupTimeLimit", "1"));
|
||||||
|
|
@ -340,7 +340,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task CheckInvalidHostingModelParameter()
|
public async Task CheckInvalidHostingModelParameter()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("hostingModel", "bogus"));
|
deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("hostingModel", "bogus"));
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -364,7 +364,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public async Task ReportsWebConfigAuthoringErrors(string scenario)
|
public async Task ReportsWebConfigAuthoringErrors(string scenario)
|
||||||
{
|
{
|
||||||
var (expectedError, action) = InvalidConfigTransformations[scenario];
|
var (expectedError, action) = InvalidConfigTransformations[scenario];
|
||||||
var iisDeploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var iisDeploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
iisDeploymentParameters.WebConfigActionList.Add((element, _) => action(element));
|
iisDeploymentParameters.WebConfigActionList.Add((element, _) => action(element));
|
||||||
var deploymentResult = await DeployAsync(iisDeploymentParameters);
|
var deploymentResult = await DeployAsync(iisDeploymentParameters);
|
||||||
var result = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
var result = await deploymentResult.HttpClient.GetAsync("/HelloWorld");
|
||||||
|
|
@ -409,7 +409,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public async Task StartsWithWebConfigVariationsPortable(string scenario)
|
public async Task StartsWithWebConfigVariationsPortable(string scenario)
|
||||||
{
|
{
|
||||||
var action = PortableConfigTransformations[scenario];
|
var action = PortableConfigTransformations[scenario];
|
||||||
var iisDeploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var iisDeploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var expectedArguments = action(iisDeploymentParameters);
|
var expectedArguments = action(iisDeploymentParameters);
|
||||||
var result = await DeployAsync(iisDeploymentParameters);
|
var result = await DeployAsync(iisDeploymentParameters);
|
||||||
Assert.Equal(expectedArguments, await result.HttpClient.GetStringAsync("/CommandLineArgs"));
|
Assert.Equal(expectedArguments, await result.HttpClient.GetStringAsync("/CommandLineArgs"));
|
||||||
|
|
@ -473,7 +473,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public async Task StartsWithWebConfigVariationsStandalone(string scenario)
|
public async Task StartsWithWebConfigVariationsStandalone(string scenario)
|
||||||
{
|
{
|
||||||
var action = StandaloneConfigTransformations[scenario];
|
var action = StandaloneConfigTransformations[scenario];
|
||||||
var iisDeploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var iisDeploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
iisDeploymentParameters.ApplicationType = ApplicationType.Standalone;
|
iisDeploymentParameters.ApplicationType = ApplicationType.Standalone;
|
||||||
var expectedArguments = action(iisDeploymentParameters);
|
var expectedArguments = action(iisDeploymentParameters);
|
||||||
var result = await DeployAsync(iisDeploymentParameters);
|
var result = await DeployAsync(iisDeploymentParameters);
|
||||||
|
|
@ -508,7 +508,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresNewHandler]
|
[RequiresNewHandler]
|
||||||
public async Task SetCurrentDirectoryHandlerSettingWorks()
|
public async Task SetCurrentDirectoryHandlerSettingWorks()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
deploymentParameters.HandlerSettings["SetCurrentDirectory"] = "false";
|
deploymentParameters.HandlerSettings["SetCurrentDirectory"] = "false";
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private async Task CheckStdoutToFile(TestVariant variant, string path)
|
private async Task CheckStdoutToFile(TestVariant variant, string path)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[MemberData(nameof(TestVariants))]
|
[MemberData(nameof(TestVariants))]
|
||||||
public async Task InvalidFilePathForLogs_ServerStillRuns(TestVariant variant)
|
public async Task InvalidFilePathForLogs_ServerStillRuns(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
|
|
||||||
deploymentParameters.WebConfigActionList.Add(
|
deploymentParameters.WebConfigActionList.Add(
|
||||||
WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogEnabled", "true"));
|
WebConfigHelpers.AddOrModifyAspNetCoreSection("stdoutLogEnabled", "true"));
|
||||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresNewShim]
|
[RequiresNewShim]
|
||||||
public async Task StartupMessagesAreLoggedIntoDebugLogFile(TestVariant variant)
|
public async Task StartupMessagesAreLoggedIntoDebugLogFile(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.HandlerSettings["debugLevel"] = "file";
|
deploymentParameters.HandlerSettings["debugLevel"] = "file";
|
||||||
deploymentParameters.HandlerSettings["debugFile"] = "subdirectory\\debug.txt";
|
deploymentParameters.HandlerSettings["debugFile"] = "subdirectory\\debug.txt";
|
||||||
|
|
||||||
|
|
@ -103,7 +103,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[MemberData(nameof(TestVariants))]
|
[MemberData(nameof(TestVariants))]
|
||||||
public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFile(TestVariant variant)
|
public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFile(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.HandlerSettings["debugLevel"] = "file";
|
deploymentParameters.HandlerSettings["debugLevel"] = "file";
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -118,7 +118,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[MemberData(nameof(TestVariants))]
|
[MemberData(nameof(TestVariants))]
|
||||||
public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFileWhenEnabledWithEnvVar(TestVariant variant)
|
public async Task StartupMessagesAreLoggedIntoDefaultDebugLogFileWhenEnabledWithEnvVar(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG"] = "file";
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG"] = "file";
|
||||||
// Add empty debugFile handler setting to prevent IIS deployer from overriding debug settings
|
// Add empty debugFile handler setting to prevent IIS deployer from overriding debug settings
|
||||||
deploymentParameters.HandlerSettings["debugFile"] = "";
|
deploymentParameters.HandlerSettings["debugFile"] = "";
|
||||||
|
|
@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG_FILE"] = firstTempFile;
|
deploymentParameters.EnvironmentVariables["ASPNETCORE_MODULE_DEBUG_FILE"] = firstTempFile;
|
||||||
deploymentParameters.AddDebugLogToWebConfig(secondTempFile);
|
deploymentParameters.AddDebugLogToWebConfig(secondTempFile);
|
||||||
|
|
||||||
|
|
@ -166,7 +166,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
public async Task DebugLogsAreWrittenToEventLog(TestVariant variant)
|
public async Task DebugLogsAreWrittenToEventLog(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.HandlerSettings["debugLevel"] = "file,eventlog";
|
deploymentParameters.HandlerSettings["debugLevel"] = "file,eventlog";
|
||||||
var deploymentResult = await StartAsync(deploymentParameters);
|
var deploymentResult = await StartAsync(deploymentParameters);
|
||||||
StopServer();
|
StopServer();
|
||||||
|
|
@ -179,7 +179,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
var path = "CheckConsoleFunctions";
|
var path = "CheckConsoleFunctions";
|
||||||
|
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, variant.HostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, variant.HostingModel);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {path}"); // For standalone this will need to remove space
|
deploymentParameters.TransformArguments((a, _) => $"{a} {path}"); // For standalone this will need to remove space
|
||||||
|
|
||||||
var logFolderPath = _logFolderPath + "\\彡⾔";
|
var logFolderPath = _logFolderPath + "\\彡⾔";
|
||||||
|
|
@ -210,7 +210,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[MemberData(nameof(TestVariants))]
|
[MemberData(nameof(TestVariants))]
|
||||||
public async Task OnlyOneFileCreatedWithProcessStartTime(TestVariant variant)
|
public async Task OnlyOneFileCreatedWithProcessStartTime(TestVariant variant)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
|
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task RunsTwoOutOfProcessApps()
|
public async Task RunsTwoOutOfProcessApps()
|
||||||
{
|
{
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);
|
||||||
parameters.ServerConfigActionList.Add(DuplicateApplication);
|
parameters.ServerConfigActionList.Add(DuplicateApplication);
|
||||||
var result = await DeployAsync(parameters);
|
var result = await DeployAsync(parameters);
|
||||||
var id1 = await result.HttpClient.GetStringAsync("/app1/ProcessId");
|
var id1 = await result.HttpClient.GetStringAsync("/app1/ProcessId");
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task FailsAndLogsWhenRunningTwoInProcessApps()
|
public async Task FailsAndLogsWhenRunningTwoInProcessApps()
|
||||||
{
|
{
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(HostingModel.InProcess, publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters(HostingModel.InProcess);
|
||||||
parameters.ServerConfigActionList.Add(DuplicateApplication);
|
parameters.ServerConfigActionList.Add(DuplicateApplication);
|
||||||
|
|
||||||
var result = await DeployAsync(parameters);
|
var result = await DeployAsync(parameters);
|
||||||
|
|
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[InlineData(HostingModel.InProcess)]
|
[InlineData(HostingModel.InProcess)]
|
||||||
public async Task FailsAndLogsEventLogForMixedHostingModel(HostingModel firstApp)
|
public async Task FailsAndLogsEventLogForMixedHostingModel(HostingModel firstApp)
|
||||||
{
|
{
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(firstApp, publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters(firstApp);
|
||||||
parameters.ServerConfigActionList.Add(DuplicateApplication);
|
parameters.ServerConfigActionList.Add(DuplicateApplication);
|
||||||
var result = await DeployAsync(parameters);
|
var result = await DeployAsync(parameters);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public async Task EnvVarInWebConfig_Valid(TestVariant variant)
|
public async Task EnvVarInWebConfig_Valid(TestVariant variant)
|
||||||
{
|
{
|
||||||
// Must publish to set env vars in web.config
|
// Must publish to set env vars in web.config
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
var port = GetUnusedRandomPort();
|
var port = GetUnusedRandomPort();
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_PORT"] = port.ToString();
|
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_PORT"] = port.ToString();
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public async Task EnvVarInWebConfig_Empty(TestVariant variant)
|
public async Task EnvVarInWebConfig_Empty(TestVariant variant)
|
||||||
{
|
{
|
||||||
// Must publish to set env vars in web.config
|
// Must publish to set env vars in web.config
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_PORT"] = string.Empty;
|
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_PORT"] = string.Empty;
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
public async Task EnvVarInWebConfig_Invalid(TestVariant variant, string port)
|
public async Task EnvVarInWebConfig_Invalid(TestVariant variant, string port)
|
||||||
{
|
{
|
||||||
// Must publish to set env vars in web.config
|
// Must publish to set env vars in web.config
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(variant);
|
||||||
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_PORT"] = port;
|
deploymentParameters.WebConfigBasedEnvironmentVariables["ASPNETCORE_PORT"] = port;
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private IISDeploymentParameters GetGlobalVersionBaseDeploymentParameters()
|
private IISDeploymentParameters GetGlobalVersionBaseDeploymentParameters()
|
||||||
{
|
{
|
||||||
return _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess, publish: true);
|
return _fixture.GetBaseDeploymentParameters(HostingModel.OutOfProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CopyDirectory(string from, string to)
|
private void CopyDirectory(string from, string to)
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,54 @@
|
||||||
// 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.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
||||||
|
using Microsoft.AspNetCore.Testing;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
public class PublishedApplicationPublisher: ApplicationPublisher
|
public class PublishedApplicationPublisher: ApplicationPublisher
|
||||||
{
|
{
|
||||||
private readonly string _applicationPath;
|
private readonly string _applicationName;
|
||||||
|
|
||||||
public PublishedApplicationPublisher(string applicationPath) : base(applicationPath)
|
public PublishedApplicationPublisher(string applicationName) : base(applicationName)
|
||||||
{
|
{
|
||||||
_applicationPath = applicationPath;
|
_applicationName = applicationName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Task<PublishedApplication> Publish(DeploymentParameters deploymentParameters, ILogger logger)
|
public override Task<PublishedApplication> Publish(DeploymentParameters deploymentParameters, ILogger logger)
|
||||||
|
{
|
||||||
|
var path = Path.Combine(AppContext.BaseDirectory, GetProfileName(deploymentParameters));
|
||||||
|
|
||||||
|
if (!Directory.Exists(path))
|
||||||
|
{
|
||||||
|
var solutionPath = GetProjectReferencePublishLocation(deploymentParameters);
|
||||||
|
logger.LogInformation("{PublishDir} doesn't exist falling back to solution based path {SolutionBasedDir}", solutionPath, solutionPath);
|
||||||
|
path = solutionPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.LogInformation("Using prepublished application from {PublishDir}", path);
|
||||||
|
|
||||||
|
var target = CreateTempDirectory();
|
||||||
|
|
||||||
|
var source = new DirectoryInfo(path);
|
||||||
|
CachingApplicationPublisher.CopyFiles(source, target, logger);
|
||||||
|
return Task.FromResult(new PublishedApplication(target.FullName, logger));
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetProjectReferencePublishLocation(DeploymentParameters deploymentParameters)
|
||||||
|
{
|
||||||
|
var testAssetsBasePath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"), "IIS", "test", "testassets", _applicationName);
|
||||||
|
var configuration = this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>().Configuration;
|
||||||
|
var path = Path.Combine(testAssetsBasePath, "bin", configuration, deploymentParameters.TargetFramework, "publish", GetProfileName(deploymentParameters));
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetProfileName(DeploymentParameters deploymentParameters)
|
||||||
{
|
{
|
||||||
// Treat AdditionalPublishParameters as profile name if defined
|
// Treat AdditionalPublishParameters as profile name if defined
|
||||||
string profileName;
|
string profileName;
|
||||||
|
|
@ -35,16 +65,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
profileName = "Standalone-" + deploymentParameters.RuntimeArchitecture;
|
profileName = "Standalone-" + deploymentParameters.RuntimeArchitecture;
|
||||||
}
|
}
|
||||||
|
|
||||||
var configuration = this.GetType().GetTypeInfo().Assembly.GetCustomAttribute<AssemblyConfigurationAttribute>().Configuration;
|
return Path.GetFileNameWithoutExtension(_applicationName) + "-" + profileName;
|
||||||
|
|
||||||
var path = Path.Combine(_applicationPath, "bin", configuration, deploymentParameters.TargetFramework, "publish", profileName);
|
|
||||||
logger.LogInformation("Using prepublished application from {PublishDir}", path);
|
|
||||||
|
|
||||||
var target = CreateTempDirectory();
|
|
||||||
|
|
||||||
var source = new DirectoryInfo(path);
|
|
||||||
CachingApplicationPublisher.CopyFiles(source, target, logger);
|
|
||||||
return Task.FromResult(new PublishedApplication(target.FullName, logger));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,44 +19,46 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
public class PublishedSitesFixture : IDisposable
|
public class PublishedSitesFixture : IDisposable
|
||||||
{
|
{
|
||||||
public PublishedApplicationPublisher InProcessTestSite { get; } = new PublishedApplicationPublisher(Helpers.GetInProcessTestSitesPath());
|
public PublishedApplicationPublisher InProcessTestSite { get; } = new PublishedApplicationPublisher(Helpers.GetInProcessTestSitesName());
|
||||||
public PublishedApplicationPublisher OutOfProcessTestSite { get; } = new PublishedApplicationPublisher(Helpers.GetOutOfProcessTestSitesPath());
|
public PublishedApplicationPublisher OutOfProcessTestSite { get; } = new PublishedApplicationPublisher(Helpers.GetOutOfProcessTestSitesName());
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public IISDeploymentParameters GetBaseDeploymentParameters(HostingModel hostingModel = HostingModel.InProcess, bool publish = false)
|
public IISDeploymentParameters GetBaseDeploymentParameters(HostingModel hostingModel = HostingModel.InProcess)
|
||||||
{
|
{
|
||||||
var publisher = hostingModel == HostingModel.InProcess ? InProcessTestSite : OutOfProcessTestSite;
|
var publisher = hostingModel == HostingModel.InProcess ? InProcessTestSite : OutOfProcessTestSite;
|
||||||
return GetBaseDeploymentParameters(publisher, hostingModel, publish);
|
return GetBaseDeploymentParameters(publisher, hostingModel);
|
||||||
}
|
|
||||||
public IISDeploymentParameters GetBaseDeploymentParameters(TestVariant variant, bool publish = false)
|
|
||||||
{
|
|
||||||
var publisher = variant.HostingModel == HostingModel.InProcess ? InProcessTestSite : OutOfProcessTestSite;
|
|
||||||
return GetBaseDeploymentParameters(publisher, new DeploymentParameters(variant), publish);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher publisher, HostingModel hostingModel = HostingModel.InProcess, bool publish = false)
|
public IISDeploymentParameters GetBaseDeploymentParameters(TestVariant variant)
|
||||||
|
{
|
||||||
|
var publisher = variant.HostingModel == HostingModel.InProcess ? InProcessTestSite : OutOfProcessTestSite;
|
||||||
|
return GetBaseDeploymentParameters(publisher, new DeploymentParameters(variant));
|
||||||
|
}
|
||||||
|
|
||||||
|
public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher publisher, HostingModel hostingModel = HostingModel.InProcess)
|
||||||
{
|
{
|
||||||
return GetBaseDeploymentParameters(
|
return GetBaseDeploymentParameters(
|
||||||
publisher,
|
publisher,
|
||||||
new DeploymentParameters(publisher.ApplicationPath, DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
|
new DeploymentParameters()
|
||||||
{
|
{
|
||||||
|
ServerType = DeployerSelector.ServerType,
|
||||||
|
RuntimeFlavor = RuntimeFlavor.CoreClr,
|
||||||
|
RuntimeArchitecture = RuntimeArchitecture.x64,
|
||||||
HostingModel = hostingModel,
|
HostingModel = hostingModel,
|
||||||
TargetFramework = Tfm.NetCoreApp30,
|
TargetFramework = Tfm.NetCoreApp30,
|
||||||
AncmVersion = AncmVersion.AspNetCoreModuleV2
|
AncmVersion = AncmVersion.AspNetCoreModuleV2
|
||||||
},
|
});
|
||||||
publish);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher publisher, DeploymentParameters baseParameters, bool publish = false)
|
public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher publisher, DeploymentParameters baseParameters)
|
||||||
{
|
{
|
||||||
return new IISDeploymentParameters(baseParameters)
|
return new IISDeploymentParameters(baseParameters)
|
||||||
{
|
{
|
||||||
ApplicationPublisher = publisher,
|
ApplicationPublisher = publisher,
|
||||||
ApplicationPath = publisher.ApplicationPath,
|
PublishApplicationBeforeDeployment = true
|
||||||
PublishApplicationBeforeDeployment = publish
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,17 +23,12 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
private static readonly TimeSpan RetryRequestDelay = TimeSpan.FromMilliseconds(100);
|
private static readonly TimeSpan RetryRequestDelay = TimeSpan.FromMilliseconds(100);
|
||||||
private static readonly int RetryRequestCount = 10;
|
private static readonly int RetryRequestCount = 10;
|
||||||
|
|
||||||
public static string GetTestWebSitePath(string name)
|
public static string GetInProcessTestSitesName()
|
||||||
{
|
{
|
||||||
return Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"),"IIS", "test", "testassets", name);
|
return DeployerSelector.IsForwardsCompatibilityTest ? "InProcessForwardsCompatWebSite" : "InProcessWebSite";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetInProcessTestSitesPath()
|
public static string GetOutOfProcessTestSitesName() => "OutOfProcessWebSite";
|
||||||
{
|
|
||||||
return DeployerSelector.IsForwardsCompatibilityTest ? GetTestWebSitePath("InProcessForwardsCompatWebSite") : GetTestWebSitePath("InProcessWebSite");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetOutOfProcessTestSitesPath() => GetTestWebSitePath("OutOfProcessWebSite");
|
|
||||||
|
|
||||||
public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld")
|
public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private static void Configure(IISDeploymentParameters deploymentParameters)
|
private static void Configure(IISDeploymentParameters deploymentParameters)
|
||||||
{
|
{
|
||||||
deploymentParameters.ApplicationPath = Helpers.GetOutOfProcessTestSitesPath();
|
deploymentParameters.ApplicationPublisher = new PublishedApplicationPublisher(Helpers.GetOutOfProcessTestSitesName());;
|
||||||
deploymentParameters.HostingModel = HostingModel.OutOfProcess;
|
deploymentParameters.HostingModel = HostingModel.OutOfProcess;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -32,7 +32,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
private static void Configure(IISDeploymentParameters deploymentParameters)
|
private static void Configure(IISDeploymentParameters deploymentParameters)
|
||||||
{
|
{
|
||||||
deploymentParameters.ApplicationPath = Helpers.GetOutOfProcessTestSitesPath();
|
deploymentParameters.ApplicationPublisher = new PublishedApplicationPublisher(Helpers.GetOutOfProcessTestSitesName());;
|
||||||
|
deploymentParameters.ApplicationPath = Helpers.GetOutOfProcessTestSitesName();
|
||||||
deploymentParameters.HostingModel = HostingModel.OutOfProcess;
|
deploymentParameters.HostingModel = HostingModel.OutOfProcess;
|
||||||
deploymentParameters.AncmVersion = AncmVersion.AspNetCoreModule;
|
deploymentParameters.AncmVersion = AncmVersion.AspNetCoreModule;
|
||||||
}
|
}
|
||||||
|
|
@ -108,21 +109,20 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var deploymentParameters = new IISDeploymentParameters(Helpers.GetInProcessTestSitesPath(),
|
var deploymentParameters = new IISDeploymentParameters()
|
||||||
DeployerSelector.ServerType,
|
|
||||||
RuntimeFlavor.CoreClr,
|
|
||||||
RuntimeArchitecture.x64)
|
|
||||||
{
|
{
|
||||||
|
RuntimeArchitecture = RuntimeArchitecture.x64,
|
||||||
|
RuntimeFlavor = RuntimeFlavor.CoreClr,
|
||||||
TargetFramework = Tfm.NetCoreApp30,
|
TargetFramework = Tfm.NetCoreApp30,
|
||||||
AncmVersion = AncmVersion.AspNetCoreModuleV2,
|
AncmVersion = AncmVersion.AspNetCoreModuleV2,
|
||||||
HostingModel = HostingModel.InProcess,
|
HostingModel = HostingModel.InProcess,
|
||||||
PublishApplicationBeforeDeployment = true
|
PublishApplicationBeforeDeployment = true,
|
||||||
|
ApplicationPublisher = new PublishedApplicationPublisher(Helpers.GetInProcessTestSitesName()),
|
||||||
|
ServerType = DeployerSelector.ServerType
|
||||||
};
|
};
|
||||||
|
|
||||||
_configure(deploymentParameters);
|
_configure(deploymentParameters);
|
||||||
|
|
||||||
deploymentParameters.ApplicationPublisher = new PublishedApplicationPublisher(deploymentParameters.ApplicationPath);
|
|
||||||
|
|
||||||
_deployer = IISApplicationDeployerFactory.Create(deploymentParameters, _loggerFactory);
|
_deployer = IISApplicationDeployerFactory.Create(deploymentParameters, _loggerFactory);
|
||||||
_deploymentResult = (IISDeploymentResult)_deployer.DeployAsync().Result;
|
_deploymentResult = (IISDeploymentResult)_deployer.DeployAsync().Result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task FrameworkNotFoundExceptionLogged_Pipe()
|
public async Task FrameworkNotFoundExceptionLogged_Pipe()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
public async Task FrameworkNotFoundExceptionLogged_File()
|
public async Task FrameworkNotFoundExceptionLogged_File()
|
||||||
{
|
{
|
||||||
var deploymentParameters =
|
var deploymentParameters =
|
||||||
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
|
|
||||||
deploymentParameters.EnableLogging(_logFolderPath);
|
deploymentParameters.EnableLogging(_logFolderPath);
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
public async Task EnableCoreHostTraceLogging_TwoLogFilesCreated()
|
public async Task EnableCoreHostTraceLogging_TwoLogFilesCreated()
|
||||||
{
|
{
|
||||||
var deploymentParameters =
|
var deploymentParameters =
|
||||||
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} CheckLargeStdOutWrites");
|
deploymentParameters.TransformArguments((a, _) => $"{a} CheckLargeStdOutWrites");
|
||||||
|
|
||||||
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
||||||
|
|
@ -100,7 +100,7 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
[InlineData("CheckOversizedStdOutWrites")]
|
[InlineData("CheckOversizedStdOutWrites")]
|
||||||
public async Task EnableCoreHostTraceLogging_PipeCaptureNativeLogs(string path)
|
public async Task EnableCoreHostTraceLogging_PipeCaptureNativeLogs(string path)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
||||||
|
|
||||||
|
|
@ -125,7 +125,7 @@ namespace IIS.FunctionalTests.Inprocess
|
||||||
public async Task EnableCoreHostTraceLogging_FileCaptureNativeLogs(string path)
|
public async Task EnableCoreHostTraceLogging_FileCaptureNativeLogs(string path)
|
||||||
{
|
{
|
||||||
var deploymentParameters =
|
var deploymentParameters =
|
||||||
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
_fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite);
|
||||||
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
deploymentParameters.EnvironmentVariables["COREHOST_TRACE"] = "1";
|
||||||
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
deploymentParameters.TransformArguments((a, _) => $"{a} {path}");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace IIS.FunctionalTests
|
||||||
// This test often hits a memory leak in warmup.dll module, it has been reported to IIS team
|
// This test often hits a memory leak in warmup.dll module, it has been reported to IIS team
|
||||||
using (AppVerifier.Disable(DeployerSelector.ServerType, 0x900))
|
using (AppVerifier.Disable(DeployerSelector.ServerType, 0x900))
|
||||||
{
|
{
|
||||||
var baseDeploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var baseDeploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
baseDeploymentParameters.TransformArguments(
|
baseDeploymentParameters.TransformArguments(
|
||||||
(args, contentRoot) => $"{args} CreateFile \"{Path.Combine(contentRoot, "Started.txt")}\"");
|
(args, contentRoot) => $"{args} CreateFile \"{Path.Combine(contentRoot, "Started.txt")}\"");
|
||||||
EnablePreload(baseDeploymentParameters);
|
EnablePreload(baseDeploymentParameters);
|
||||||
|
|
@ -58,7 +58,7 @@ namespace IIS.FunctionalTests
|
||||||
// This test often hits a memory leak in warmup.dll module, it has been reported to IIS team
|
// This test often hits a memory leak in warmup.dll module, it has been reported to IIS team
|
||||||
using (AppVerifier.Disable(DeployerSelector.ServerType, 0x900))
|
using (AppVerifier.Disable(DeployerSelector.ServerType, 0x900))
|
||||||
{
|
{
|
||||||
var baseDeploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var baseDeploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
EnablePreload(baseDeploymentParameters);
|
EnablePreload(baseDeploymentParameters);
|
||||||
|
|
||||||
baseDeploymentParameters.ServerConfigActionList.Add(
|
baseDeploymentParameters.ServerConfigActionList.Add(
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[RequiresIIS(IISCapability.WindowsAuthentication)]
|
[RequiresIIS(IISCapability.WindowsAuthentication)]
|
||||||
public async Task Authentication_InProcess()
|
public async Task Authentication_InProcess()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters();
|
||||||
deploymentParameters.SetWindowsAuth();
|
deploymentParameters.SetWindowsAuth();
|
||||||
|
|
||||||
var deploymentResult = await DeployAsync(deploymentParameters);
|
var deploymentResult = await DeployAsync(deploymentParameters);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task ServerShutsDownWhenMainExits()
|
public async Task ServerShutsDownWhenMainExits()
|
||||||
{
|
{
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var deploymentResult = await DeployAsync(parameters);
|
var deploymentResult = await DeployAsync(parameters);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task ServerShutsDownWhenMainExitsStress()
|
public async Task ServerShutsDownWhenMainExitsStress()
|
||||||
{
|
{
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var deploymentResult = await StartAsync(parameters);
|
var deploymentResult = await StartAsync(parameters);
|
||||||
|
|
||||||
var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => {
|
var load = Helpers.StressLoad(deploymentResult.HttpClient, "/HelloWorld", response => {
|
||||||
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task GracefulShutdown_DoesNotCrashProcess()
|
public async Task GracefulShutdown_DoesNotCrashProcess()
|
||||||
{
|
{
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var result = await DeployAsync(parameters);
|
var result = await DeployAsync(parameters);
|
||||||
|
|
||||||
var response = await result.HttpClient.GetAsync("/HelloWorld");
|
var response = await result.HttpClient.GetAsync("/HelloWorld");
|
||||||
|
|
@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
public async Task ForcefulShutdown_DoesCrashProcess()
|
public async Task ForcefulShutdown_DoesCrashProcess()
|
||||||
{
|
{
|
||||||
var parameters = _fixture.GetBaseDeploymentParameters(publish: true);
|
var parameters = _fixture.GetBaseDeploymentParameters();
|
||||||
var result = await DeployAsync(parameters);
|
var result = await DeployAsync(parameters);
|
||||||
|
|
||||||
var response = await result.HttpClient.GetAsync("/HelloWorld");
|
var response = await result.HttpClient.GetAsync("/HelloWorld");
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
// fails due to not modifying the apphost.config file.
|
// fails due to not modifying the apphost.config file.
|
||||||
return UpgradeFeatureDetectionDeployer(
|
return UpgradeFeatureDetectionDeployer(
|
||||||
disableWebSocket: true,
|
disableWebSocket: true,
|
||||||
Helpers.GetInProcessTestSitesPath(),
|
|
||||||
"Disabled", HostingModel.InProcess);
|
"Disabled", HostingModel.InProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,7 +37,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
return UpgradeFeatureDetectionDeployer(
|
return UpgradeFeatureDetectionDeployer(
|
||||||
disableWebSocket: false,
|
disableWebSocket: false,
|
||||||
Helpers.GetInProcessTestSitesPath(),
|
|
||||||
_isWebsocketsSupported, HostingModel.InProcess);
|
_isWebsocketsSupported, HostingModel.InProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,7 +45,6 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
return UpgradeFeatureDetectionDeployer(
|
return UpgradeFeatureDetectionDeployer(
|
||||||
disableWebSocket: true,
|
disableWebSocket: true,
|
||||||
Helpers.GetOutOfProcessTestSitesPath(),
|
|
||||||
"Disabled", HostingModel.OutOfProcess);
|
"Disabled", HostingModel.OutOfProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,13 +53,12 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
return UpgradeFeatureDetectionDeployer(
|
return UpgradeFeatureDetectionDeployer(
|
||||||
disableWebSocket: false,
|
disableWebSocket: false,
|
||||||
Helpers.GetOutOfProcessTestSitesPath(),
|
|
||||||
_isWebsocketsSupported, HostingModel.OutOfProcess);
|
_isWebsocketsSupported, HostingModel.OutOfProcess);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task UpgradeFeatureDetectionDeployer(bool disableWebSocket, string sitePath, string expected, HostingModel hostingModel)
|
private async Task UpgradeFeatureDetectionDeployer(bool disableWebSocket, string expected, HostingModel hostingModel)
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel);
|
||||||
|
|
||||||
if (disableWebSocket)
|
if (disableWebSocket)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||||
|
<TestAssetOutputName>InProcessForwardsCompatWebSite</TestAssetOutputName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
|
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,10 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
|
||||||
}
|
}
|
||||||
|
|
||||||
public IISDeploymentParameters(
|
public IISDeploymentParameters(
|
||||||
string applicationPath,
|
string applicationPath,
|
||||||
ServerType serverType,
|
ServerType serverType,
|
||||||
RuntimeFlavor runtimeFlavor,
|
RuntimeFlavor runtimeFlavor,
|
||||||
RuntimeArchitecture runtimeArchitecture)
|
RuntimeArchitecture runtimeArchitecture)
|
||||||
: base(applicationPath, serverType, runtimeFlavor, runtimeArchitecture)
|
: base(applicationPath, serverType, runtimeFlavor, runtimeArchitecture)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -115,27 +115,30 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
|
||||||
|
|
||||||
private string CheckIfPublishIsRequired()
|
private string CheckIfPublishIsRequired()
|
||||||
{
|
{
|
||||||
|
string dllRoot = null;
|
||||||
var targetFramework = DeploymentParameters.TargetFramework;
|
var targetFramework = DeploymentParameters.TargetFramework;
|
||||||
|
if (!string.IsNullOrEmpty(DeploymentParameters.ApplicationPath))
|
||||||
// IISIntegration uses this layout
|
|
||||||
var dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.RuntimeArchitecture.ToString(),
|
|
||||||
DeploymentParameters.Configuration, targetFramework);
|
|
||||||
|
|
||||||
if (!Directory.Exists(dllRoot))
|
|
||||||
{
|
{
|
||||||
// Most repos use this layout
|
// IISIntegration uses this layout
|
||||||
dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework);
|
dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.RuntimeArchitecture.ToString(),
|
||||||
|
DeploymentParameters.Configuration, targetFramework);
|
||||||
|
|
||||||
if (!Directory.Exists(dllRoot))
|
if (!Directory.Exists(dllRoot))
|
||||||
{
|
{
|
||||||
// The bits we need weren't pre-compiled, compile on publish
|
// Most repos use this layout
|
||||||
DeploymentParameters.PublishApplicationBeforeDeployment = true;
|
dllRoot = Path.Combine(DeploymentParameters.ApplicationPath, "bin", DeploymentParameters.Configuration, targetFramework);
|
||||||
}
|
|
||||||
else if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr
|
if (!Directory.Exists(dllRoot))
|
||||||
&& DeploymentParameters.RuntimeArchitecture == RuntimeArchitecture.x86)
|
{
|
||||||
{
|
// The bits we need weren't pre-compiled, compile on publish
|
||||||
// x64 is the default. Publish to rebuild for the right bitness
|
DeploymentParameters.PublishApplicationBeforeDeployment = true;
|
||||||
DeploymentParameters.PublishApplicationBeforeDeployment = true;
|
}
|
||||||
|
else if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr
|
||||||
|
&& DeploymentParameters.RuntimeArchitecture == RuntimeArchitecture.x86)
|
||||||
|
{
|
||||||
|
// x64 is the default. Publish to rebuild for the right bitness
|
||||||
|
DeploymentParameters.PublishApplicationBeforeDeployment = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,12 @@
|
||||||
<IISExpressAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.config</IISExpressAppHostConfig>
|
<IISExpressAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.config</IISExpressAppHostConfig>
|
||||||
<IISAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.iis.config</IISAppHostConfig>
|
<IISAppHostConfig>$(MSBuildThisFileDirectory)applicationhost.iis.config</IISAppHostConfig>
|
||||||
<PreserveCompilationContext>false</PreserveCompilationContext>
|
<PreserveCompilationContext>false</PreserveCompilationContext>
|
||||||
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
|
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
|
||||||
<!-- Work around until we get a new WebSdk -->
|
<!-- Work around until we get a new WebSdk -->
|
||||||
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
|
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
|
||||||
<BuildProjectReferences Condition="'$(_InsidePublishTestsAssets)' == 'True'">False</BuildProjectReferences>
|
<HasTestAssetProfile Condition="'$(TestAssetProfile)' != ''">true</HasTestAssetProfile>
|
||||||
|
<AppendRuntimeIdentifierToOutputPath Condition="'$(HasTestAssetProfile)' == 'true'">false</AppendRuntimeIdentifierToOutputPath>
|
||||||
|
<TestAssetOutputName Condition="'$(TestAssetOutputName)' == ''">$(MSBuildProjectName)</TestAssetOutputName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Import Project="assets.props" />
|
<Import Project="assets.props" />
|
||||||
|
|
@ -26,14 +28,6 @@
|
||||||
<NativeFolder>x64</NativeFolder>
|
<NativeFolder>x64</NativeFolder>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- For standalone publish, all dlls are flattened to the same folder.
|
|
||||||
Set the base path to the request handler
|
|
||||||
-->
|
|
||||||
<BasePathForRequestHandler Condition="'$(RuntimeIdentifier)' == ''">$(NativePlatform)\</BasePathForRequestHandler>
|
|
||||||
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<IISExpressArguments>/config:"$(IISExpressAppHostConfig)" /systray:false</IISExpressArguments>
|
<IISExpressArguments>/config:"$(IISExpressAppHostConfig)" /systray:false</IISExpressArguments>
|
||||||
<IISArguments>-h "$(IISAppHostConfig)"</IISArguments>
|
<IISArguments>-h "$(IISAppHostConfig)"</IISArguments>
|
||||||
|
|
@ -50,7 +44,7 @@
|
||||||
<!-- Deps file injection-->
|
<!-- Deps file injection-->
|
||||||
<ItemGroup Condition="('$(InProcessTestSite)' == 'true') AND ('$(ReferenceTestTasks)' != 'false')">
|
<ItemGroup Condition="('$(InProcessTestSite)' == 'true') AND ('$(ReferenceTestTasks)' != 'false')">
|
||||||
<ProjectReference Include="$(MSBuildThisFileDirectory)..\IIS\test\testassets\TestTasks\TestTasks.csproj">
|
<ProjectReference Include="$(MSBuildThisFileDirectory)..\IIS\test\testassets\TestTasks\TestTasks.csproj">
|
||||||
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
|
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
@ -64,7 +58,6 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|
||||||
<Target Name="InjectRequestHandler"
|
<Target Name="InjectRequestHandler"
|
||||||
Condition=" '$(InProcessTestSite)' == 'true' AND '$(BuildIisNativeProjects)' == 'true' AND '$(TargetFrameworkIdentifier)' != '.NETFramework'"
|
Condition=" '$(InProcessTestSite)' == 'true' AND '$(BuildIisNativeProjects)' == 'true' AND '$(TargetFrameworkIdentifier)' != '.NETFramework'"
|
||||||
AfterTargets="GenerateBuildDependencyFile"
|
AfterTargets="GenerateBuildDependencyFile"
|
||||||
|
|
@ -79,7 +72,24 @@
|
||||||
<Exec Command="$(InjectDepsApp) "$(PublishDepsFilePath)" $(RuntimeIdentifier) " />
|
<Exec Command="$(InjectDepsApp) "$(PublishDepsFilePath)" $(RuntimeIdentifier) " />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PublishTestsAssets" AfterTargets="Build" Condition="'$(_InsidePublishTestsAssets)' != 'true' AND '@(TestAssetPublishProfile->Count())' != '0'">
|
<Target Name="PreventProjectReferencesFromBuilding" BeforeTargets="BeforeResolveReferences" Condition="'@(TestAssetPublishProfile->Count())' != '0'">
|
||||||
|
<PropertyGroup>
|
||||||
|
<BuildProjectReferences Condition="'$(HasTestAssetProfile)' == 'true'">false</BuildProjectReferences>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="PrepareForTestAssetPublish" BeforeTargets="PrepareForPublish" Condition="'@(TestAssetPublishProfile->Count())' != '0'">
|
||||||
|
<PropertyGroup Condition="'$(HasTestAssetProfile)' == 'true'">
|
||||||
|
<PublishDir>$(OutputPath)$(PublishDirName)\$(TestAssetOutputName)-$(TestAssetProfile)\</PublishDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(HasTestAssetProfile)' != 'true'">
|
||||||
|
<IsPublishable>false</IsPublishable>
|
||||||
|
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="PublishTestsAssets" AfterTargets="Build;Publish" Condition="'$(TestAssetProfile)' == '' AND '@(TestAssetPublishProfile->Count())' != '0'">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
_InsidePublishTestsAssets is to avoid invoking this target recursively
|
_InsidePublishTestsAssets is to avoid invoking this target recursively
|
||||||
|
|
@ -87,6 +97,6 @@
|
||||||
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
||||||
Targets="Publish"
|
Targets="Publish"
|
||||||
RemoveProperties="Platform;PlatformTarget"
|
RemoveProperties="Platform;PlatformTarget"
|
||||||
Properties="ReferenceTestTasks=false;_InsidePublishTestsAssets=True;PublishDir=$(PublishDir)%(TestAssetPublishProfile.Identity)/;%(TestAssetPublishProfile.Properties)" />
|
Properties="TestAssetProfile=%(TestAssetPublishProfile.Identity);ReferenceTestTasks=false;%(TestAssetPublishProfile.Properties)" />
|
||||||
</Target>
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue