From b30f0d3b9019224c973c8108312155378c5c4d98 Mon Sep 17 00:00:00 2001 From: "Chris Ross (ASP.NET)" Date: Thu, 3 May 2018 15:30:28 -0700 Subject: [PATCH] Change to a test matrix approach --- ServerTests.sln | 3 + build/dependencies.props | 30 +-- .../HelloWorldTest.cs | 103 ++++----- .../Helpers.cs | 18 -- .../NtlmAuthenticationTest.cs | 36 +-- .../ResponseCompressionTests.cs | 211 ++++------------- .../ResponseTests.cs | 212 +++--------------- 7 files changed, 144 insertions(+), 469 deletions(-) diff --git a/ServerTests.sln b/ServerTests.sln index bd58846053..348408541c 100644 --- a/ServerTests.sln +++ b/ServerTests.sln @@ -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 diff --git a/build/dependencies.props b/build/dependencies.props index 15a43ff712..0e11099be1 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,24 +4,24 @@ 2.2.0-preview1-17051 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-a-preview1-useiis-16873 - 2.2.0-a-preview1-useiis-16873 - 0.6.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 - 2.2.0-preview1-34184 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 0.6.0-a-preview1-inttesting-17031 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 + 2.2.0-preview1-34217 2.0.0 2.1.0-rc1 2.2.0-preview1-26509-06 - 2.2.0-preview1-34184 + 2.2.0-preview1-34217 15.6.1 2.0.3 1.4.0 diff --git a/test/ServerComparison.FunctionalTests/HelloWorldTest.cs b/test/ServerComparison.FunctionalTests/HelloWorldTest.cs index b0cde0c343..2ee7e0cd19 100644 --- a/test/ServerComparison.FunctionalTests/HelloWorldTest.cs +++ b/test/ServerComparison.FunctionalTests/HelloWorldTest.cs @@ -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()); + } } } } diff --git a/test/ServerComparison.FunctionalTests/Helpers.cs b/test/ServerComparison.FunctionalTests/Helpers.cs index 78ba02114f..68f9e62c08 100644 --- a/test/ServerComparison.FunctionalTests/Helpers.cs +++ b/test/ServerComparison.FunctionalTests/Helpers.cs @@ -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}'"); - } } } \ No newline at end of file diff --git a/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs b/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs index 6f00797e78..dc1c8d1feb 100644 --- a/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs +++ b/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs @@ -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)) diff --git a/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs b/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs index 7d0b203419..cd0f135e90 100644 --- a/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs +++ b/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs @@ -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 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)) diff --git a/test/ServerComparison.FunctionalTests/ResponseTests.cs b/test/ServerComparison.FunctionalTests/ResponseTests.cs index 973d36cee4..9d47fcad57 100644 --- a/test/ServerComparison.FunctionalTests/ResponseTests.cs +++ b/test/ServerComparison.FunctionalTests/ResponseTests.cs @@ -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 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 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))