Change to a test matrix approach
This commit is contained in:
parent
e4ea92d7a3
commit
b30f0d3b90
|
|
@ -4,6 +4,8 @@ VisualStudioVersion = 15.0.27130.2036
|
||||||
MinimumVisualStudioVersion = 15.0.26730.03
|
MinimumVisualStudioVersion = 15.0.26730.03
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{49AB8AAA-8160-48DF-A18B-78F51E54E02A}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{49AB8AAA-8160-48DF-A18B-78F51E54E02A}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
.appveyor.yml = .appveyor.yml
|
||||||
|
.travis.yml = .travis.yml
|
||||||
Directory.Build.props = Directory.Build.props
|
Directory.Build.props = Directory.Build.props
|
||||||
Directory.Build.targets = Directory.Build.targets
|
Directory.Build.targets = Directory.Build.targets
|
||||||
NuGet.config = NuGet.config
|
NuGet.config = NuGet.config
|
||||||
|
|
@ -20,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{55694E45
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
build\dependencies.props = build\dependencies.props
|
build\dependencies.props = build\dependencies.props
|
||||||
build\repo.props = build\repo.props
|
build\repo.props = build\repo.props
|
||||||
|
build\sources.props = build\sources.props
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
|
|
|
||||||
|
|
@ -4,24 +4,24 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="Package Versions">
|
<PropertyGroup Label="Package Versions">
|
||||||
<InternalAspNetCoreSdkPackageVersion>2.2.0-preview1-17051</InternalAspNetCoreSdkPackageVersion>
|
<InternalAspNetCoreSdkPackageVersion>2.2.0-preview1-17051</InternalAspNetCoreSdkPackageVersion>
|
||||||
<MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreAspNetCoreModulePackageVersion>
|
<MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreAspNetCoreModulePackageVersion>
|
||||||
<MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>
|
<MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>
|
||||||
<MicrosoftAspNetCoreResponseCompressionPackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreResponseCompressionPackageVersion>
|
<MicrosoftAspNetCoreResponseCompressionPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreResponseCompressionPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerHttpSysPackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreServerHttpSysPackageVersion>
|
<MicrosoftAspNetCoreServerHttpSysPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreServerHttpSysPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.2.0-a-preview1-useiis-16873</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerIISPackageVersion>2.2.0-a-preview1-useiis-16873</MicrosoftAspNetCoreServerIISPackageVersion>
|
<MicrosoftAspNetCoreServerIISPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreServerIISPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-preview1-34184</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
|
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-a-preview1-inttesting-17031</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
||||||
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingConsolePackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsLoggingConsolePackageVersion>
|
<MicrosoftExtensionsLoggingConsolePackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||||
<MicrosoftExtensionsLoggingPackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsLoggingPackageVersion>
|
<MicrosoftExtensionsLoggingPackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsLoggingPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingTestingPackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsLoggingTestingPackageVersion>
|
<MicrosoftExtensionsLoggingTestingPackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||||
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
|
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
|
||||||
<MicrosoftNETCoreApp21PackageVersion>2.1.0-rc1</MicrosoftNETCoreApp21PackageVersion>
|
<MicrosoftNETCoreApp21PackageVersion>2.1.0-rc1</MicrosoftNETCoreApp21PackageVersion>
|
||||||
<MicrosoftNETCoreApp22PackageVersion>2.2.0-preview1-26509-06</MicrosoftNETCoreApp22PackageVersion>
|
<MicrosoftNETCoreApp22PackageVersion>2.2.0-preview1-26509-06</MicrosoftNETCoreApp22PackageVersion>
|
||||||
<MicrosoftNetHttpHeadersPackageVersion>2.2.0-preview1-34184</MicrosoftNetHttpHeadersPackageVersion>
|
<MicrosoftNetHttpHeadersPackageVersion>2.2.0-preview1-34217</MicrosoftNetHttpHeadersPackageVersion>
|
||||||
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
|
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
|
||||||
<NETStandardLibrary20PackageVersion>2.0.3</NETStandardLibrary20PackageVersion>
|
<NETStandardLibrary20PackageVersion>2.0.3</NETStandardLibrary20PackageVersion>
|
||||||
<SerilogExtensionsLoggingPackageVersion>1.4.0</SerilogExtensionsLoggingPackageVersion>
|
<SerilogExtensionsLoggingPackageVersion>1.4.0</SerilogExtensionsLoggingPackageVersion>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// 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.Runtime.CompilerServices;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
||||||
using Microsoft.AspNetCore.Testing.xunit;
|
using Microsoft.AspNetCore.Testing.xunit;
|
||||||
|
|
@ -19,77 +19,28 @@ namespace ServerComparison.FunctionalTests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
public static TestMatrix TestVariants
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
.WithAllApplicationTypes()
|
||||||
public Task HelloWorld_WebListener(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
.WithAllAncmVersions()
|
||||||
{
|
.WithAllHostingModels();
|
||||||
return HelloWorld(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(TestVariants))]
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
public async Task HelloWorld(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
public Task HelloWorld_IISExpress(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
|
||||||
{
|
{
|
||||||
return HelloWorld(ServerType.IISExpress, runtimeFlavor, RuntimeArchitecture.x64, applicationType, hostingModel: hostingModel, ancmVersion: ancmVersion);
|
var testName = $"HelloWorld_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
|
||||||
public Task HelloWorld_Kestrel_Clr(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return HelloWorld(ServerType.Kestrel, runtimeFlavor, RuntimeArchitecture.x64, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task HelloWorld_Kestrel(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return HelloWorld(ServerType.Kestrel, runtimeFlavor, RuntimeArchitecture.x64, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Windows)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task HelloWorld_Nginx(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return HelloWorld(ServerType.Nginx, runtimeFlavor, RuntimeArchitecture.x64, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private async Task HelloWorld(ServerType serverType,
|
|
||||||
RuntimeFlavor runtimeFlavor,
|
|
||||||
RuntimeArchitecture architecture,
|
|
||||||
ApplicationType applicationType,
|
|
||||||
[CallerMemberName] string testName = null,
|
|
||||||
HostingModel hostingModel = HostingModel.OutOfProcess,
|
|
||||||
ANCMVersion ancmVersion = ANCMVersion.AspNetCoreModule)
|
|
||||||
{
|
|
||||||
testName = $"{testName}_{serverType}_{runtimeFlavor}_{architecture}_{applicationType}";
|
|
||||||
using (StartLog(out var loggerFactory, testName))
|
using (StartLog(out var loggerFactory, testName))
|
||||||
{
|
{
|
||||||
var logger = loggerFactory.CreateLogger("HelloWorld");
|
var logger = loggerFactory.CreateLogger("HelloWorld");
|
||||||
|
|
||||||
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(applicationType), serverType, runtimeFlavor, architecture)
|
var deploymentParameters = new DeploymentParameters(variant)
|
||||||
{
|
{
|
||||||
|
ApplicationPath = Helpers.GetApplicationPath(variant.ApplicationType),
|
||||||
EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld',
|
EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld',
|
||||||
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType, "Http.config", "nginx.conf"),
|
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "Http.config", "nginx.conf"),
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = Helpers.GetTargetFramework(runtimeFlavor),
|
|
||||||
ApplicationType = applicationType,
|
|
||||||
HostingModel = hostingModel,
|
|
||||||
ANCMVersion = ancmVersion
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
@ -113,6 +64,34 @@ namespace ServerComparison.FunctionalTests
|
||||||
logger.LogWarning(responseText);
|
logger.LogWarning(responseText);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure it was the right server.
|
||||||
|
var serverHeader = response.Headers.Server.ToString();
|
||||||
|
switch (variant.Server)
|
||||||
|
{
|
||||||
|
case ServerType.HttpSys:
|
||||||
|
Assert.Equal("Microsoft-HTTPAPI/2.0", serverHeader);
|
||||||
|
break;
|
||||||
|
case ServerType.Nginx:
|
||||||
|
Assert.StartsWith("nginx/", serverHeader);
|
||||||
|
break;
|
||||||
|
case ServerType.Kestrel:
|
||||||
|
Assert.Equal("Kestrel", serverHeader);
|
||||||
|
break;
|
||||||
|
case ServerType.IIS:
|
||||||
|
case ServerType.IISExpress:
|
||||||
|
if (variant.HostingModel == HostingModel.OutOfProcess)
|
||||||
|
{
|
||||||
|
Assert.Equal("Kestrel", serverHeader);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Assert.StartsWith("Microsoft-IIS/", serverHeader);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new NotImplementedException(variant.Server.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,23 +45,5 @@ namespace ServerComparison.FunctionalTests
|
||||||
|
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetTargetFramework(RuntimeFlavor runtimeFlavor)
|
|
||||||
{
|
|
||||||
if (runtimeFlavor == RuntimeFlavor.Clr)
|
|
||||||
{
|
|
||||||
return "net461";
|
|
||||||
}
|
|
||||||
else if (runtimeFlavor == RuntimeFlavor.CoreClr)
|
|
||||||
{
|
|
||||||
#if NETCOREAPP2_2 || NET461
|
|
||||||
return "netcoreapp2.2";
|
|
||||||
#else
|
|
||||||
#error Target frameworks need to be updated.
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new ArgumentException($"Unknown RuntimeFlavor '{runtimeFlavor}'");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -20,39 +20,27 @@ namespace ServerComparison.FunctionalTests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static TestMatrix TestVariants
|
||||||
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.HttpSys)
|
||||||
|
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||||
|
.WithAllAncmVersions()
|
||||||
|
.WithAllHostingModels();
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(TestVariants))]
|
||||||
[InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, "net461", RuntimeArchitecture.x64, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
public async Task NtlmAuthentication(TestVariant variant)
|
||||||
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, "netcoreapp2.2", RuntimeArchitecture.x64, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, "netcoreapp2.2", RuntimeArchitecture.x64, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, "netcoreapp2.2", RuntimeArchitecture.x64, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, "netcoreapp2.2", RuntimeArchitecture.x64, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, "netcoreapp2.2", RuntimeArchitecture.x64, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, "netcoreapp2.2", RuntimeArchitecture.x64, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, "netcoreapp2.2", RuntimeArchitecture.x64, ApplicationType.Portable)]
|
|
||||||
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, "netcoreapp2.2", RuntimeArchitecture.x64, ApplicationType.Standalone)]
|
|
||||||
public async Task NtlmAuthentication(ServerType serverType,
|
|
||||||
RuntimeFlavor runtimeFlavor,
|
|
||||||
string targetFramework,
|
|
||||||
RuntimeArchitecture architecture,
|
|
||||||
ApplicationType applicationType,
|
|
||||||
HostingModel hostingModel = HostingModel.OutOfProcess,
|
|
||||||
ANCMVersion ancmVersion = ANCMVersion.AspNetCoreModule)
|
|
||||||
{
|
{
|
||||||
var testName = $"NtlmAuthentication_{serverType}_{runtimeFlavor}_{architecture}_{applicationType}";
|
var testName = $"NtlmAuthentication_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||||
using (StartLog(out var loggerFactory, testName))
|
using (StartLog(out var loggerFactory, testName))
|
||||||
{
|
{
|
||||||
var logger = loggerFactory.CreateLogger("NtlmAuthenticationTest");
|
var logger = loggerFactory.CreateLogger("NtlmAuthenticationTest");
|
||||||
|
|
||||||
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(applicationType), serverType, runtimeFlavor, architecture)
|
var deploymentParameters = new DeploymentParameters(variant)
|
||||||
{
|
{
|
||||||
|
ApplicationPath = Helpers.GetApplicationPath(variant.ApplicationType),
|
||||||
EnvironmentName = "NtlmAuthentication", // Will pick the Start class named 'StartupNtlmAuthentication'
|
EnvironmentName = "NtlmAuthentication", // Will pick the Start class named 'StartupNtlmAuthentication'
|
||||||
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType, "NtlmAuthentication.config", nginxConfig: null),
|
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "NtlmAuthentication.config", nginxConfig: null),
|
||||||
SiteName = "NtlmAuthenticationTestSite", // This is configured in the NtlmAuthentication.config
|
SiteName = "NtlmAuthenticationTestSite", // This is configured in the NtlmAuthentication.config
|
||||||
TargetFramework = targetFramework,
|
|
||||||
ApplicationType = applicationType,
|
|
||||||
HostingModel = hostingModel,
|
|
||||||
ANCMVersion = ancmVersion
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
// 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;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
@ -30,210 +29,76 @@ namespace ServerComparison.FunctionalTests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// IIS Express
|
public static TestMatrix NoCompressionTestVariants
|
||||||
[ConditionalTheory]
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys)
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
.WithAllAncmVersions()
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
.WithAllHostingModels();
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
public Task ResponseCompression_IISExpress_NoCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
|
||||||
{
|
|
||||||
return ResponseCompression(ServerType.IISExpress,
|
|
||||||
runtimeFlavor,
|
|
||||||
RuntimeArchitecture.x64,
|
|
||||||
CheckNoCompressionAsync,
|
|
||||||
applicationType,
|
|
||||||
hostCompression: false,
|
|
||||||
hostingModel: hostingModel,
|
|
||||||
ancmVersion: ancmVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(NoCompressionTestVariants))]
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
public Task ResponseCompression_NoCompression(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
public Task ResponseCompression_IISExpress_HostCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
|
||||||
{
|
{
|
||||||
return ResponseCompression(ServerType.IISExpress,
|
return ResponseCompression(variant, CheckNoCompressionAsync, hostCompression: false);
|
||||||
runtimeFlavor,
|
|
||||||
RuntimeArchitecture.x64,
|
|
||||||
CheckHostCompressionAsync,
|
|
||||||
applicationType,
|
|
||||||
hostCompression: true,
|
|
||||||
hostingModel: hostingModel,
|
|
||||||
ancmVersion: ancmVersion);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory(Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
public static TestMatrix HostCompressionTestVariants
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Nginx)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
.WithAllAncmVersions()
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
.WithAllHostingModels();
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
public Task ResponseCompression_IISExpress_AppCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
|
||||||
{
|
|
||||||
return ResponseCompression(ServerType.IISExpress,
|
|
||||||
runtimeFlavor,
|
|
||||||
RuntimeArchitecture.x64,
|
|
||||||
CheckAppCompressionAsync,
|
|
||||||
applicationType,
|
|
||||||
hostCompression: true,
|
|
||||||
hostingModel: hostingModel,
|
|
||||||
ancmVersion: ancmVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
|
||||||
public Task ResponseCompression_IISExpress_AppAndHostCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
|
||||||
{
|
|
||||||
return ResponseCompression(ServerType.IISExpress,
|
|
||||||
runtimeFlavor,
|
|
||||||
RuntimeArchitecture.x64,
|
|
||||||
CheckAppCompressionAsync,
|
|
||||||
applicationType,
|
|
||||||
hostCompression: true,
|
|
||||||
hostingModel: hostingModel,
|
|
||||||
ancmVersion: ancmVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
// WebListener
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseCompression_WebListener_NoCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseCompression(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckNoCompressionAsync, applicationType, hostCompression: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// WebListener doesn't support HostCompression
|
|
||||||
// "The archive entry was compressed using an unsupported compression method."
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(HostCompressionTestVariants))]
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
public Task ResponseCompression_HostCompression(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseCompression_WebListener_AppCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
{
|
||||||
return ResponseCompression(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckAppCompressionAsync, applicationType, hostCompression: false);
|
return ResponseCompression(variant, CheckHostCompressionAsync, hostCompression: true);
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseCompression_WebListener_AppAndHostCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseCompression(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckAppCompressionAsync, applicationType, hostCompression: true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Kestrel
|
public static TestMatrix AppCompressionTestVariants
|
||||||
[Theory]
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.HttpSys) // No pass-through compression for nginx
|
||||||
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
|
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||||
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
|
.WithAllAncmVersions()
|
||||||
public Task ResponseCompression_Kestrel_NoCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
.WithAllHostingModels();
|
||||||
{
|
|
||||||
return ResponseCompression(serverType, runtimeFlavor, architecture, CheckNoCompressionAsync, applicationType, hostCompression: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
|
|
||||||
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseCompression_Kestrel_AppCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseCompression(serverType, runtimeFlavor, architecture, CheckAppCompressionAsync, applicationType, hostCompression: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Nginx
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Windows)]
|
|
||||||
[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
|
|
||||||
[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseCompression_Nginx_NoCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseCompression(serverType, runtimeFlavor, architecture, CheckNoCompressionAsync, applicationType, hostCompression: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Windows)]
|
[MemberData(nameof(AppCompressionTestVariants))]
|
||||||
[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
|
public Task ResponseCompression_AppCompression(TestVariant variant)
|
||||||
[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseCompression_Nginx_HostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
|
||||||
{
|
{
|
||||||
return ResponseCompression(serverType, runtimeFlavor, architecture, CheckHostCompressionAsync, applicationType, hostCompression: true);
|
return ResponseCompression(variant, CheckAppCompressionAsync, hostCompression: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory(Skip = "No pass-through compression https://github.com/aspnet/BasicMiddleware/issues/123")]
|
public static TestMatrix HostAndAppCompressionTestVariants
|
||||||
[OSSkipCondition(OperatingSystems.Windows)]
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys)
|
||||||
[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
|
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||||
[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
|
.WithAllAncmVersions()
|
||||||
public Task ResponseCompression_Nginx_AppCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
.WithAllHostingModels();
|
||||||
{
|
|
||||||
return ResponseCompression(serverType, runtimeFlavor, architecture, CheckHostCompressionAsync, applicationType, hostCompression: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Windows)]
|
[MemberData(nameof(HostAndAppCompressionTestVariants))]
|
||||||
[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
|
public Task ResponseCompression_AppAndHostCompression(TestVariant variant)
|
||||||
[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseCompression_Nginx_AppAndHostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
|
||||||
{
|
{
|
||||||
return ResponseCompression(serverType, runtimeFlavor, architecture, CheckAppCompressionAsync, applicationType, hostCompression: true);
|
return ResponseCompression(variant, CheckAppCompressionAsync, hostCompression: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ResponseCompression(ServerType serverType,
|
private async Task ResponseCompression(TestVariant variant,
|
||||||
RuntimeFlavor runtimeFlavor,
|
|
||||||
RuntimeArchitecture architecture,
|
|
||||||
Func<HttpClient, ILogger, Task> scenario,
|
Func<HttpClient, ILogger, Task> scenario,
|
||||||
ApplicationType applicationType,
|
|
||||||
bool hostCompression,
|
bool hostCompression,
|
||||||
[CallerMemberName] string testName = null,
|
[CallerMemberName] string testName = null)
|
||||||
HostingModel hostingModel = HostingModel.OutOfProcess,
|
|
||||||
ANCMVersion ancmVersion = ANCMVersion.AspNetCoreModule)
|
|
||||||
{
|
{
|
||||||
testName = $"{testName}_{serverType}_{runtimeFlavor}_{architecture}_{applicationType}";
|
testName = $"{testName}_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||||
using (StartLog(out var loggerFactory, testName))
|
using (StartLog(out var loggerFactory, testName))
|
||||||
{
|
{
|
||||||
var logger = loggerFactory.CreateLogger("ResponseCompression");
|
var logger = loggerFactory.CreateLogger("ResponseCompression");
|
||||||
|
|
||||||
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(applicationType), serverType, runtimeFlavor, architecture)
|
var deploymentParameters = new DeploymentParameters(variant)
|
||||||
{
|
{
|
||||||
|
ApplicationPath = Helpers.GetApplicationPath(variant.ApplicationType),
|
||||||
EnvironmentName = "ResponseCompression",
|
EnvironmentName = "ResponseCompression",
|
||||||
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType,
|
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server,
|
||||||
hostCompression ? "http.config" : "NoCompression.config",
|
hostCompression ? "http.config" : "NoCompression.config",
|
||||||
hostCompression ? "nginx.conf" : "NoCompression.conf"),
|
hostCompression ? "nginx.conf" : "NoCompression.conf"),
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = Helpers.GetTargetFramework(runtimeFlavor),
|
|
||||||
ApplicationType = applicationType,
|
|
||||||
HostingModel = hostingModel,
|
|
||||||
ANCMVersion = ancmVersion
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
|
|
@ -24,214 +24,72 @@ namespace ServerComparison.FunctionalTests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// IIS Express
|
public static TestMatrix TestVariants
|
||||||
|
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys)
|
||||||
|
.WithTfms(Tfm.NetCoreApp22)
|
||||||
|
.WithAllAncmVersions()
|
||||||
|
.WithAllHostingModels();
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(TestVariants))]
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
public Task ResponseFormats_ContentLength(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
public Task ResponseFormats_IISExpress_ContentLength(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
|
||||||
{
|
{
|
||||||
return ResponseFormats(ServerType.IISExpress, runtimeFlavor, RuntimeArchitecture.x64, CheckContentLengthAsync, applicationType, hostingModel: hostingModel, ancmVersion: ancmVersion);
|
return ResponseFormats(variant, CheckContentLengthAsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(TestVariants))]
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
public Task ResponseFormats_Chunked(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2, Skip = "Failing after dependencies.props update. Issue to un-skip: https://github.com/aspnet/ServerTests/issues/110")]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2, Skip = "Failing after dependencies.props update. Issue to un-skip: https://github.com/aspnet/ServerTests/issues/110")]
|
|
||||||
public Task ResponseFormats_IISExpress_Chunked(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
|
||||||
{
|
{
|
||||||
return ResponseFormats(ServerType.IISExpress, runtimeFlavor, RuntimeArchitecture.x64, CheckChunkedAsync, applicationType, hostingModel: hostingModel, ancmVersion: ancmVersion);
|
return ResponseFormats(variant, CheckChunkedAsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(TestVariants))]
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
public Task ResponseFormats_ManuallyChunk(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.InProcess, ANCMVersion.AspNetCoreModuleV2)]
|
|
||||||
public Task ResponseFormats_IIS_ManuallyChunk(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
|
||||||
{
|
{
|
||||||
return ResponseFormats(ServerType.IISExpress, runtimeFlavor, RuntimeArchitecture.x64, CheckManuallyChunkedAsync, applicationType, hostingModel: hostingModel, ancmVersion: ancmVersion);
|
return ResponseFormats(variant, CheckManuallyChunkedAsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Weblistener
|
public static TestMatrix SelfhostTestVariants
|
||||||
|
=> TestMatrix.ForServers(ServerType.Kestrel, ServerType.HttpSys)
|
||||||
|
.WithTfms(Tfm.NetCoreApp22);
|
||||||
|
|
||||||
|
// Connection Close tests do not work through reverse proxies
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(SelfhostTestVariants))]
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
public Task ResponseFormats_Http10ConnectionClose(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_WebListener_ContentLength(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
{
|
||||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckContentLengthAsync, applicationType);
|
return ResponseFormats(variant, CheckHttp10ConnectionCloseAsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(SelfhostTestVariants))]
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
public Task ResponseFormats_Http11ConnectionClose(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_WebListener_Chunked(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
{
|
||||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckChunkedAsync, applicationType);
|
return ResponseFormats(variant, CheckHttp11ConnectionCloseAsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory]
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
[MemberData(nameof(SelfhostTestVariants))]
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
public Task ResponseFormats_ManuallyChunkAndClose(TestVariant variant)
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
// IIS will remove the "Connection: close" header https://github.com/aspnet/IISIntegration/issues/7
|
|
||||||
public Task ResponseFormats_WebListener_Http10ConnectionClose(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
{
|
||||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckHttp10ConnectionCloseAsync, applicationType);
|
return ResponseFormats(variant, CheckManuallyChunkedAndCloseAsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
private async Task ResponseFormats(TestVariant variant, Func<HttpClient, ILogger, Task> scenario, [CallerMemberName] string testName = null)
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)] // https://github.com/aspnet/WebListener/issues/259
|
|
||||||
// IIS will remove the "Connection: close" header https://github.com/aspnet/IISIntegration/issues/7
|
|
||||||
public Task ResponseFormats_WebListener_Http11ConnectionClose(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
{
|
||||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckHttp11ConnectionCloseAsync, applicationType);
|
testName = $"{testName}_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_WebListener_ManuallyChunk(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckManuallyChunkedAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
|
||||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_WebListener_ManuallyChunkAndClose(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckManuallyChunkedAndCloseAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Kestrel
|
|
||||||
[Theory]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Kestrel_ContentLength(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Kestrel, runtimeFlavor, RuntimeArchitecture.x64, CheckContentLengthAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Kestrel_Http10ConnectionClose(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Kestrel, runtimeFlavor, RuntimeArchitecture.x64, CheckHttp10ConnectionCloseAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Kestrel_Http11ConnectionClose(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Kestrel, runtimeFlavor, RuntimeArchitecture.x64, CheckHttp11ConnectionCloseAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Kestrel_Chunked(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Kestrel, runtimeFlavor, RuntimeArchitecture.x64, CheckChunkedAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Kestrel_ManuallyChunk(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Kestrel, runtimeFlavor, RuntimeArchitecture.x64, CheckManuallyChunkedAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Theory]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Kestrel_ManuallyChunkAndClose(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Kestrel, runtimeFlavor, RuntimeArchitecture.x64, CheckManuallyChunkedAndCloseAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Nginx
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Windows)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Nginx_ContentLength( RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Nginx, runtimeFlavor, RuntimeArchitecture.x64, CheckContentLengthAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Windows)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Nginx_Chunked(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Nginx, runtimeFlavor, RuntimeArchitecture.x64, CheckChunkedAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[ConditionalTheory]
|
|
||||||
[OSSkipCondition(OperatingSystems.Windows)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
|
||||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
|
||||||
public Task ResponseFormats_Nginx_ManuallyChunk(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
|
||||||
{
|
|
||||||
return ResponseFormats(ServerType.Nginx, runtimeFlavor, RuntimeArchitecture.x64, CheckManuallyChunkedAsync, applicationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task ResponseFormats(ServerType serverType,
|
|
||||||
RuntimeFlavor runtimeFlavor,
|
|
||||||
RuntimeArchitecture architecture,
|
|
||||||
Func<HttpClient, ILogger, Task> scenario,
|
|
||||||
ApplicationType applicationType,
|
|
||||||
[CallerMemberName] string testName = null,
|
|
||||||
HostingModel hostingModel = HostingModel.OutOfProcess,
|
|
||||||
ANCMVersion ancmVersion = ANCMVersion.AspNetCoreModule)
|
|
||||||
{
|
|
||||||
testName = $"{testName}_{serverType}_{runtimeFlavor}_{architecture}_{applicationType}";
|
|
||||||
using (StartLog(out var loggerFactory, testName))
|
using (StartLog(out var loggerFactory, testName))
|
||||||
{
|
{
|
||||||
var logger = loggerFactory.CreateLogger("ResponseFormats");
|
var logger = loggerFactory.CreateLogger("ResponseFormats");
|
||||||
|
|
||||||
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(applicationType), serverType, runtimeFlavor, architecture)
|
var deploymentParameters = new DeploymentParameters(variant)
|
||||||
{
|
{
|
||||||
|
ApplicationPath = Helpers.GetApplicationPath(variant.ApplicationType),
|
||||||
EnvironmentName = "Responses",
|
EnvironmentName = "Responses",
|
||||||
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType, "Http.config", "nginx.conf"),
|
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server, "Http.config", "nginx.conf"),
|
||||||
SiteName = "HttpTestSite", // This is configured in the Http.config
|
SiteName = "HttpTestSite", // This is configured in the Http.config
|
||||||
TargetFramework = Helpers.GetTargetFramework(runtimeFlavor),
|
|
||||||
ApplicationType = applicationType,
|
|
||||||
HostingModel = hostingModel,
|
|
||||||
ANCMVersion = ancmVersion
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue