зеркало из https://github.com/aspnet/ServerTests.git
Change to a test matrix approach
This commit is contained in:
Родитель
e4ea92d7a3
Коммит
b30f0d3b90
|
@ -4,6 +4,8 @@ VisualStudioVersion = 15.0.27130.2036
|
|||
MinimumVisualStudioVersion = 15.0.26730.03
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{49AB8AAA-8160-48DF-A18B-78F51E54E02A}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.appveyor.yml = .appveyor.yml
|
||||
.travis.yml = .travis.yml
|
||||
Directory.Build.props = Directory.Build.props
|
||||
Directory.Build.targets = Directory.Build.targets
|
||||
NuGet.config = NuGet.config
|
||||
|
@ -20,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{55694E45
|
|||
ProjectSection(SolutionItems) = preProject
|
||||
build\dependencies.props = build\dependencies.props
|
||||
build\repo.props = build\repo.props
|
||||
build\sources.props = build\sources.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
|
|
|
@ -4,24 +4,24 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Label="Package Versions">
|
||||
<InternalAspNetCoreSdkPackageVersion>2.2.0-preview1-17051</InternalAspNetCoreSdkPackageVersion>
|
||||
<MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreAspNetCoreModulePackageVersion>
|
||||
<MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>
|
||||
<MicrosoftAspNetCoreResponseCompressionPackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreResponseCompressionPackageVersion>
|
||||
<MicrosoftAspNetCoreServerHttpSysPackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreServerHttpSysPackageVersion>
|
||||
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.2.0-a-preview1-useiis-16873</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
||||
<MicrosoftAspNetCoreServerIISPackageVersion>2.2.0-a-preview1-useiis-16873</MicrosoftAspNetCoreServerIISPackageVersion>
|
||||
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-preview1-34184</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
|
||||
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
||||
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview1-34184</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConsolePackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||
<MicrosoftExtensionsLoggingPackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsLoggingPackageVersion>
|
||||
<MicrosoftExtensionsLoggingTestingPackageVersion>2.2.0-preview1-34184</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||
<MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreAspNetCoreModulePackageVersion>
|
||||
<MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>
|
||||
<MicrosoftAspNetCoreResponseCompressionPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreResponseCompressionPackageVersion>
|
||||
<MicrosoftAspNetCoreServerHttpSysPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreServerHttpSysPackageVersion>
|
||||
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
||||
<MicrosoftAspNetCoreServerIISPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreServerIISPackageVersion>
|
||||
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.6.0-a-preview1-inttesting-17031</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
|
||||
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
||||
<MicrosoftAspNetCoreWebUtilitiesPackageVersion>2.2.0-preview1-34217</MicrosoftAspNetCoreWebUtilitiesPackageVersion>
|
||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||
<MicrosoftExtensionsLoggingConsolePackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||
<MicrosoftExtensionsLoggingPackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsLoggingPackageVersion>
|
||||
<MicrosoftExtensionsLoggingTestingPackageVersion>2.2.0-preview1-34217</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
|
||||
<MicrosoftNETCoreApp21PackageVersion>2.1.0-rc1</MicrosoftNETCoreApp21PackageVersion>
|
||||
<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>
|
||||
<NETStandardLibrary20PackageVersion>2.0.3</NETStandardLibrary20PackageVersion>
|
||||
<SerilogExtensionsLoggingPackageVersion>1.4.0</SerilogExtensionsLoggingPackageVersion>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Server.IntegrationTesting;
|
||||
using Microsoft.AspNetCore.Testing.xunit;
|
||||
|
@ -19,77 +19,28 @@ namespace ServerComparison.FunctionalTests
|
|||
{
|
||||
}
|
||||
|
||||
[ConditionalTheory]
|
||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
||||
public Task HelloWorld_WebListener(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
||||
{
|
||||
return HelloWorld(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, applicationType);
|
||||
}
|
||||
public static TestMatrix TestVariants
|
||||
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys)
|
||||
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||
.WithAllApplicationTypes()
|
||||
.WithAllAncmVersions()
|
||||
.WithAllHostingModels();
|
||||
|
||||
[ConditionalTheory]
|
||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule)]
|
||||
[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)
|
||||
[MemberData(nameof(TestVariants))]
|
||||
public async Task HelloWorld(TestVariant variant)
|
||||
{
|
||||
return HelloWorld(ServerType.IISExpress, runtimeFlavor, RuntimeArchitecture.x64, applicationType, hostingModel: hostingModel, ancmVersion: ancmVersion);
|
||||
}
|
||||
|
||||
[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}";
|
||||
var testName = $"HelloWorld_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||
using (StartLog(out var loggerFactory, testName))
|
||||
{
|
||||
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',
|
||||
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
|
||||
TargetFramework = Helpers.GetTargetFramework(runtimeFlavor),
|
||||
ApplicationType = applicationType,
|
||||
HostingModel = hostingModel,
|
||||
ANCMVersion = ancmVersion
|
||||
};
|
||||
|
||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||
|
@ -113,6 +64,34 @@ namespace ServerComparison.FunctionalTests
|
|||
logger.LogWarning(responseText);
|
||||
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;
|
||||
}
|
||||
|
||||
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]
|
||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
||||
[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")]
|
||||
[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)
|
||||
[MemberData(nameof(TestVariants))]
|
||||
public async Task NtlmAuthentication(TestVariant variant)
|
||||
{
|
||||
var testName = $"NtlmAuthentication_{serverType}_{runtimeFlavor}_{architecture}_{applicationType}";
|
||||
var testName = $"NtlmAuthentication_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||
using (StartLog(out var loggerFactory, testName))
|
||||
{
|
||||
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'
|
||||
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
|
||||
TargetFramework = targetFramework,
|
||||
ApplicationType = applicationType,
|
||||
HostingModel = hostingModel,
|
||||
ANCMVersion = ancmVersion
|
||||
};
|
||||
|
||||
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.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
|
@ -30,210 +29,76 @@ namespace ServerComparison.FunctionalTests
|
|||
{
|
||||
}
|
||||
|
||||
// IIS Express
|
||||
[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_NoCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
||||
{
|
||||
return ResponseCompression(ServerType.IISExpress,
|
||||
runtimeFlavor,
|
||||
RuntimeArchitecture.x64,
|
||||
CheckNoCompressionAsync,
|
||||
applicationType,
|
||||
hostCompression: false,
|
||||
hostingModel: hostingModel,
|
||||
ancmVersion: ancmVersion);
|
||||
}
|
||||
public static TestMatrix NoCompressionTestVariants
|
||||
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys)
|
||||
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||
.WithAllAncmVersions()
|
||||
.WithAllHostingModels();
|
||||
|
||||
[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_HostCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType, HostingModel hostingModel, ANCMVersion ancmVersion)
|
||||
[MemberData(nameof(NoCompressionTestVariants))]
|
||||
public Task ResponseCompression_NoCompression(TestVariant variant)
|
||||
{
|
||||
return ResponseCompression(ServerType.IISExpress,
|
||||
runtimeFlavor,
|
||||
RuntimeArchitecture.x64,
|
||||
CheckHostCompressionAsync,
|
||||
applicationType,
|
||||
hostCompression: true,
|
||||
hostingModel: hostingModel,
|
||||
ancmVersion: ancmVersion);
|
||||
return ResponseCompression(variant, CheckNoCompressionAsync, hostCompression: false);
|
||||
}
|
||||
|
||||
[ConditionalTheory(Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
||||
[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_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."
|
||||
public static TestMatrix HostCompressionTestVariants
|
||||
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Nginx)
|
||||
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||
.WithAllAncmVersions()
|
||||
.WithAllHostingModels();
|
||||
|
||||
[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_AppCompression(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
||||
[MemberData(nameof(HostCompressionTestVariants))]
|
||||
public Task ResponseCompression_HostCompression(TestVariant variant)
|
||||
{
|
||||
return ResponseCompression(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckAppCompressionAsync, applicationType, hostCompression: false);
|
||||
}
|
||||
|
||||
[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);
|
||||
return ResponseCompression(variant, CheckHostCompressionAsync, hostCompression: true);
|
||||
}
|
||||
|
||||
// Kestrel
|
||||
[Theory]
|
||||
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)]
|
||||
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)]
|
||||
public Task ResponseCompression_Kestrel_NoCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
||||
{
|
||||
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);
|
||||
}
|
||||
public static TestMatrix AppCompressionTestVariants
|
||||
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.HttpSys) // No pass-through compression for nginx
|
||||
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||
.WithAllAncmVersions()
|
||||
.WithAllHostingModels();
|
||||
|
||||
[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_HostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
||||
[MemberData(nameof(AppCompressionTestVariants))]
|
||||
public Task ResponseCompression_AppCompression(TestVariant variant)
|
||||
{
|
||||
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")]
|
||||
[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_AppCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
||||
{
|
||||
return ResponseCompression(serverType, runtimeFlavor, architecture, CheckHostCompressionAsync, applicationType, hostCompression: false);
|
||||
}
|
||||
public static TestMatrix HostAndAppCompressionTestVariants
|
||||
=> TestMatrix.ForServers(ServerType.IISExpress, ServerType.Kestrel, ServerType.Nginx, ServerType.HttpSys)
|
||||
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
|
||||
.WithAllAncmVersions()
|
||||
.WithAllHostingModels();
|
||||
|
||||
[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_AppAndHostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType)
|
||||
[MemberData(nameof(HostAndAppCompressionTestVariants))]
|
||||
public Task ResponseCompression_AppAndHostCompression(TestVariant variant)
|
||||
{
|
||||
return ResponseCompression(serverType, runtimeFlavor, architecture, CheckAppCompressionAsync, applicationType, hostCompression: true);
|
||||
return ResponseCompression(variant, CheckAppCompressionAsync, hostCompression: true);
|
||||
}
|
||||
|
||||
private async Task ResponseCompression(ServerType serverType,
|
||||
RuntimeFlavor runtimeFlavor,
|
||||
RuntimeArchitecture architecture,
|
||||
private async Task ResponseCompression(TestVariant variant,
|
||||
Func<HttpClient, ILogger, Task> scenario,
|
||||
ApplicationType applicationType,
|
||||
bool hostCompression,
|
||||
[CallerMemberName] string testName = null,
|
||||
HostingModel hostingModel = HostingModel.OutOfProcess,
|
||||
ANCMVersion ancmVersion = ANCMVersion.AspNetCoreModule)
|
||||
[CallerMemberName] string testName = null)
|
||||
{
|
||||
testName = $"{testName}_{serverType}_{runtimeFlavor}_{architecture}_{applicationType}";
|
||||
testName = $"{testName}_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||
using (StartLog(out var loggerFactory, testName))
|
||||
{
|
||||
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",
|
||||
ServerConfigTemplateContent = Helpers.GetConfigContent(serverType,
|
||||
ServerConfigTemplateContent = Helpers.GetConfigContent(variant.Server,
|
||||
hostCompression ? "http.config" : "NoCompression.config",
|
||||
hostCompression ? "nginx.conf" : "NoCompression.conf"),
|
||||
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))
|
||||
|
|
|
@ -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]
|
||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
||||
[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)
|
||||
[MemberData(nameof(TestVariants))]
|
||||
public Task ResponseFormats_ContentLength(TestVariant variant)
|
||||
{
|
||||
return ResponseFormats(ServerType.IISExpress, runtimeFlavor, RuntimeArchitecture.x64, CheckContentLengthAsync, applicationType, hostingModel: hostingModel, ancmVersion: ancmVersion);
|
||||
return ResponseFormats(variant, CheckContentLengthAsync);
|
||||
}
|
||||
|
||||
[ConditionalTheory]
|
||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
||||
[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)
|
||||
[MemberData(nameof(TestVariants))]
|
||||
public Task ResponseFormats_Chunked(TestVariant variant)
|
||||
{
|
||||
return ResponseFormats(ServerType.IISExpress, runtimeFlavor, RuntimeArchitecture.x64, CheckChunkedAsync, applicationType, hostingModel: hostingModel, ancmVersion: ancmVersion);
|
||||
return ResponseFormats(variant, CheckChunkedAsync);
|
||||
}
|
||||
|
||||
[ConditionalTheory]
|
||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable, HostingModel.OutOfProcess, ANCMVersion.AspNetCoreModule, Skip = "Websdk issue with full framework publish. See https://github.com/aspnet/websdk/pull/322")]
|
||||
[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)
|
||||
[MemberData(nameof(TestVariants))]
|
||||
public Task ResponseFormats_ManuallyChunk(TestVariant variant)
|
||||
{
|
||||
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]
|
||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Portable)]
|
||||
[InlineData(RuntimeFlavor.CoreClr, ApplicationType.Standalone)]
|
||||
public Task ResponseFormats_WebListener_ContentLength(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
||||
[MemberData(nameof(SelfhostTestVariants))]
|
||||
public Task ResponseFormats_Http10ConnectionClose(TestVariant variant)
|
||||
{
|
||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckContentLengthAsync, applicationType);
|
||||
return ResponseFormats(variant, CheckHttp10ConnectionCloseAsync);
|
||||
}
|
||||
|
||||
[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_Chunked(RuntimeFlavor runtimeFlavor, ApplicationType applicationType)
|
||||
[MemberData(nameof(SelfhostTestVariants))]
|
||||
public Task ResponseFormats_Http11ConnectionClose(TestVariant variant)
|
||||
{
|
||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckChunkedAsync, applicationType);
|
||||
return ResponseFormats(variant, CheckHttp11ConnectionCloseAsync);
|
||||
}
|
||||
|
||||
[ConditionalTheory]
|
||||
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
|
||||
[InlineData(RuntimeFlavor.Clr, ApplicationType.Portable)]
|
||||
[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)
|
||||
[MemberData(nameof(SelfhostTestVariants))]
|
||||
public Task ResponseFormats_ManuallyChunkAndClose(TestVariant variant)
|
||||
{
|
||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckHttp10ConnectionCloseAsync, applicationType);
|
||||
return ResponseFormats(variant, CheckManuallyChunkedAndCloseAsync);
|
||||
}
|
||||
|
||||
[ConditionalTheory]
|
||||
[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)
|
||||
private async Task ResponseFormats(TestVariant variant, Func<HttpClient, ILogger, Task> scenario, [CallerMemberName] string testName = null)
|
||||
{
|
||||
return ResponseFormats(ServerType.WebListener, runtimeFlavor, RuntimeArchitecture.x64, CheckHttp11ConnectionCloseAsync, 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}";
|
||||
testName = $"{testName}_{variant.Server}_{variant.Tfm}_{variant.Architecture}_{variant.ApplicationType}";
|
||||
using (StartLog(out var loggerFactory, testName))
|
||||
{
|
||||
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",
|
||||
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
|
||||
TargetFramework = Helpers.GetTargetFramework(runtimeFlavor),
|
||||
ApplicationType = applicationType,
|
||||
HostingModel = hostingModel,
|
||||
ANCMVersion = ancmVersion
|
||||
};
|
||||
|
||||
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, loggerFactory))
|
||||
|
|
Загрузка…
Ссылка в новой задаче