From cf64cf2c4a5563665b646f332887a7e6a67939d4 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 15 Nov 2017 18:00:01 -0800 Subject: [PATCH] Update samples and tests to target netcoreapp2.1 --- build/dependencies.props | 24 ++++----- test/Directory.Build.props | 3 +- .../HelloWorldTest.cs | 15 ++++-- .../Helpers.cs | 25 +++++++++ .../NtlmAuthenticationTest.cs | 16 +++--- .../ResponseCompressionTests.cs | 54 ++++++++++++------- .../ResponseTests.cs | 47 ++++++---------- 7 files changed, 108 insertions(+), 76 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 2b41ee0efe..d37bc43e7c 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,19 +5,19 @@ 2.1.0-preview1-15550 1.0.0-pre-10141 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 0.5.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 + 2.1.0-preview1-27595 + 2.1.0-preview1-27595 + 2.1.0-preview1-27595 + 0.5.0-preview1-27595 + 2.1.0-preview1-27595 + 2.1.0-preview1-27595 + 2.1.0-preview1-27595 + 2.1.0-preview1-27595 + 2.1.0-preview1-27595 + 2.1.0-preview1-27595 + 2.1.0-preview1-27595 2.0.0 - 2.1.0-preview1-27498 + 2.1.0-preview1-27595 15.3.0 1.4.0 3.2.0 diff --git a/test/Directory.Build.props b/test/Directory.Build.props index b6b79cae3b..620b803d21 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,9 +2,8 @@ - netcoreapp2.1 + netcoreapp2.1;netcoreapp2.0 $(DeveloperBuildTestTfms) - netcoreapp2.1;netcoreapp2.0 $(StandardTestTfms);net461 diff --git a/test/ServerComparison.FunctionalTests/HelloWorldTest.cs b/test/ServerComparison.FunctionalTests/HelloWorldTest.cs index 4db87d05c0..2febca4269 100644 --- a/test/ServerComparison.FunctionalTests/HelloWorldTest.cs +++ b/test/ServerComparison.FunctionalTests/HelloWorldTest.cs @@ -19,15 +19,22 @@ namespace ServerComparison.FunctionalTests { } + [ConditionalTheory] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] + [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] + [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x86, ApplicationType.Portable, Skip = "Tests disabled on x86 because of https://github.com/aspnet/Hosting/issues/601")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] + public Task HelloWorld_Windows_CLR(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + { + return HelloWorld(serverType, runtimeFlavor, architecture, applicationType); + } + [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, ApplicationType.Portable, Skip = "Tests disabled on x86 because of https://github.com/aspnet/Hosting/issues/601")] - [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] - [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x86, ApplicationType.Portable, Skip = "Tests disabled on x86 because of https://github.com/aspnet/Hosting/issues/601")] [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)] [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone)] - [InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] public Task HelloWorld_Windows(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) { return HelloWorld(serverType, runtimeFlavor, architecture, applicationType); @@ -63,7 +70,7 @@ namespace ServerComparison.FunctionalTests EnvironmentName = "HelloWorld", // Will pick the Start class named 'StartupHelloWorld', ServerConfigTemplateContent = Helpers.GetConfigContent(serverType, "Http.config", "nginx.conf"), SiteName = "HttpTestSite", // This is configured in the Http.config - TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", + TargetFramework = Helpers.GetTargetFramework(runtimeFlavor), ApplicationType = applicationType }; diff --git a/test/ServerComparison.FunctionalTests/Helpers.cs b/test/ServerComparison.FunctionalTests/Helpers.cs index 68f9e62c08..4086cb8232 100644 --- a/test/ServerComparison.FunctionalTests/Helpers.cs +++ b/test/ServerComparison.FunctionalTests/Helpers.cs @@ -45,5 +45,30 @@ namespace ServerComparison.FunctionalTests return content; } + + public static string GetTargetFramework(RuntimeFlavor runtimeFlavor) + { + if (runtimeFlavor == RuntimeFlavor.Clr) + { +#if NET461 + return "net461"; +#elif NETCOREAPP2_0 || NETCOREAPP2_1 +#else +#error Tests targeting CLR must be compiled only on desktop. +#endif + } + else if (runtimeFlavor == RuntimeFlavor.CoreClr) + { +#if NETCOREAPP2_0 + return "netcoreapp2.0"; +#elif NETCOREAPP2_1 || NET461 + return "netcoreapp2.1"; +#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 12649aa148..fe74296449 100644 --- a/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs +++ b/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs @@ -25,12 +25,14 @@ namespace ServerComparison.FunctionalTests [Trait("ServerComparison.FunctionalTests", "ServerComparison.FunctionalTests")] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] - [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, ApplicationType.Portable, Skip = "https://github.com/aspnet/Hosting/issues/601")] - [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] - [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x86, ApplicationType.Portable, Skip = "https://github.com/aspnet/Hosting/issues/601")] - [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)] - [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/96")] - public async Task NtlmAuthentication(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, "netcoreapp2.0", RuntimeArchitecture.x86, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] + [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, "netcoreapp2.1", RuntimeArchitecture.x86, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] + [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, "net461", RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] + [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, "netcoreapp2.0", RuntimeArchitecture.x64, ApplicationType.Portable)] + [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, "netcoreapp2.1", RuntimeArchitecture.x64, ApplicationType.Portable)] + [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, "netcoreapp2.0", RuntimeArchitecture.x64, ApplicationType.Standalone)] + [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, "netcoreapp2.1", RuntimeArchitecture.x64, ApplicationType.Standalone)] + public async Task NtlmAuthentication(ServerType serverType, RuntimeFlavor runtimeFlavor, string targetFramework, RuntimeArchitecture architecture, ApplicationType applicationType) { var testName = $"NtlmAuthentication_{serverType}_{runtimeFlavor}_{architecture}_{applicationType}"; using (StartLog(out var loggerFactory, testName)) @@ -42,7 +44,7 @@ namespace ServerComparison.FunctionalTests EnvironmentName = "NtlmAuthentication", // Will pick the Start class named 'StartupNtlmAuthentication' ServerConfigTemplateContent = Helpers.GetConfigContent(serverType, "NtlmAuthentication.config", nginxConfig: null), SiteName = "NtlmAuthenticationTestSite", // This is configured in the NtlmAuthentication.config - TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", + TargetFramework = targetFramework, ApplicationType = applicationType }; diff --git a/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs b/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs index c1c70a670e..4ab6246809 100644 --- a/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs +++ b/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs @@ -31,8 +31,7 @@ namespace ServerComparison.FunctionalTests } [ConditionalTheory] - [OSSkipCondition(OperatingSystems.Linux)] - [OSSkipCondition(OperatingSystems.MacOSX)] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] public Task ResponseCompression_Windows_NoCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) @@ -57,14 +56,20 @@ namespace ServerComparison.FunctionalTests return ResponseCompression(serverType, runtimeFlavor, architecture, CheckNoCompressionAsync, applicationType, hostCompression: false); } - [ConditionalTheory] + [ConditionalFact(Skip = "https://github.com/aspnet/ServerTests/issues/96")] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] - [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] - [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/96")] - public Task ResponseCompression_Windows_HostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + public Task ResponseCompression_Windows_HostCompression() { - return ResponseCompression(serverType, runtimeFlavor, architecture, CheckHostCompressionAsync, applicationType, hostCompression: true); + return ResponseCompression(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, CheckHostCompressionAsync, ApplicationType.Portable, hostCompression: true); + } + + [ConditionalFact(Skip = "https://github.com/aspnet/ServerTests/issues/96")] + [OSSkipCondition(OperatingSystems.Linux)] + [OSSkipCondition(OperatingSystems.MacOSX)] + public Task ResponseCompression_Windows_HostCompression_CLR() + { + return ResponseCompression(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, CheckHostCompressionAsync, ApplicationType.Portable, hostCompression: true); } [ConditionalTheory] @@ -76,14 +81,19 @@ namespace ServerComparison.FunctionalTests return ResponseCompression(serverType, runtimeFlavor, architecture, CheckHostCompressionAsync, applicationType, hostCompression: true); } - [ConditionalTheory] + [ConditionalFact] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] + public Task ResponseCompression_Windows_AppCompression_CLR() + { + return ResponseCompression(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, CheckAppCompressionAsync, ApplicationType.Portable, hostCompression: false); + } + + [ConditionalFact(Skip = "https://github.com/aspnet/ServerTests/issues/96")] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] - [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/96")] - [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] - public Task ResponseCompression_Windows_AppCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + public Task ResponseCompression_Windows_AppCompression() { - return ResponseCompression(serverType, runtimeFlavor, architecture, CheckAppCompressionAsync, applicationType, hostCompression: false); + return ResponseCompression(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, CheckAppCompressionAsync, ApplicationType.Standalone, hostCompression: false); } [Theory] @@ -103,14 +113,19 @@ namespace ServerComparison.FunctionalTests return ResponseCompression(serverType, runtimeFlavor, architecture, CheckHostCompressionAsync, applicationType, hostCompression: false); } - [ConditionalTheory] + [ConditionalFact(Skip = "https://github.com/aspnet/ServerTests/issues/96")] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] - [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Standalone , Skip = "https://github.com/aspnet/ServerTests/issues/96")] - [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] - public Task ResponseCompression_Windows_AppAndHostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) + public Task ResponseCompression_Windows_AppAndHostCompression() { - return ResponseCompression(serverType, runtimeFlavor, architecture, CheckAppCompressionAsync, applicationType, hostCompression: true); + return ResponseCompression(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, CheckAppCompressionAsync, ApplicationType.Standalone, hostCompression: true); + } + + [ConditionalFact(Skip = "https://github.com/aspnet/ServerTests/issues/96")] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] + public Task ResponseCompression_Windows_AppAndHostCompression_CLR() + { + return ResponseCompression(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, CheckAppCompressionAsync, ApplicationType.Portable, hostCompression: true); } [ConditionalTheory] @@ -136,7 +151,7 @@ namespace ServerComparison.FunctionalTests hostCompression ? "http.config" : "NoCompression.config", hostCompression ? "nginx.conf" : "NoCompression.conf"), SiteName = "HttpTestSite", // This is configured in the Http.config - TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", + TargetFramework = Helpers.GetTargetFramework(runtimeFlavor), ApplicationType = applicationType }; @@ -227,8 +242,7 @@ namespace ServerComparison.FunctionalTests private static string GetContentLength(HttpResponseMessage response) { // Don't use response.Content.Headers.ContentLength, it will dynamically calculate the value if it can. - IEnumerable values; - return response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out values) ? values.FirstOrDefault() : null; + return response.Content.Headers.TryGetValues(HeaderNames.ContentLength, out var values) ? values.FirstOrDefault() : null; } private static async Task ReadCompressedAsStringAsync(HttpContent content) diff --git a/test/ServerComparison.FunctionalTests/ResponseTests.cs b/test/ServerComparison.FunctionalTests/ResponseTests.cs index b2a3accdc8..fb327afaf8 100644 --- a/test/ServerComparison.FunctionalTests/ResponseTests.cs +++ b/test/ServerComparison.FunctionalTests/ResponseTests.cs @@ -24,15 +24,14 @@ namespace ServerComparison.FunctionalTests { } -#if NET461 - [Theory] - [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] + [ConditionalTheory] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] + [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] public Task ResponseFormats_Windows_ContentLength(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, CheckContentLengthAsync, applicationType); } -#endif [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)] @@ -51,8 +50,8 @@ namespace ServerComparison.FunctionalTests return ResponseFormats(serverType, runtimeFlavor, architecture, CheckContentLengthAsync, applicationType); } -#if NET461 - [Theory] + [ConditionalTheory] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] // IIS will remove the "Connection: close" header https://github.com/aspnet/IISIntegration/issues/7 public Task ResponseFormats_Windows_Http10ConnectionClose(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) @@ -61,14 +60,14 @@ namespace ServerComparison.FunctionalTests } - [Theory] + [ConditionalTheory] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] // https://github.com/aspnet/WebListener/issues/259 // IIS will remove the "Connection: close" header https://github.com/aspnet/IISIntegration/issues/7 public Task ResponseFormats_Windows_Http11ConnectionClose(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, CheckHttp11ConnectionCloseAsync, applicationType); } -#endif [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)] @@ -86,15 +85,14 @@ namespace ServerComparison.FunctionalTests return ResponseFormats(serverType, runtimeFlavor, architecture, CheckHttp11ConnectionCloseAsync, applicationType); } -#if NET461 - [Theory] - [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] + [ConditionalTheory] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] + [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] public Task ResponseFormats_Windows_Chunked(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, CheckChunkedAsync, applicationType); } -#endif [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)] @@ -113,15 +111,14 @@ namespace ServerComparison.FunctionalTests return ResponseFormats(serverType, runtimeFlavor, architecture, CheckChunkedAsync, applicationType); } -#if NET461 - [Theory] - [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] + [ConditionalTheory] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] + [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable, Skip = "https://github.com/aspnet/ServerTests/issues/96")] [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] public Task ResponseFormats_Windows_ManuallyChunk(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, CheckManuallyChunkedAsync, applicationType); } -#endif [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)] @@ -140,15 +137,14 @@ namespace ServerComparison.FunctionalTests return ResponseFormats(serverType, runtimeFlavor, architecture, CheckManuallyChunkedAsync, applicationType); } -#if NET461 - [Theory] + [ConditionalTheory] + [FrameworkSkipCondition(RuntimeFrameworks.CoreCLR)] // [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] // https://github.com/aspnet/IISIntegration/issues/7 [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, ApplicationType.Portable)] public Task ResponseFormats_Windows_ManuallyChunkAndClose(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, CheckManuallyChunkedAndCloseAsync, applicationType); } -#endif [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, ApplicationType.Portable)] @@ -160,17 +156,6 @@ namespace ServerComparison.FunctionalTests private async Task ResponseFormats(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, Func scenario, ApplicationType applicationType, [CallerMemberName] string testName = null) { - var targetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : -#if NETCOREAPP2_0 - "netcoreapp2.0"; -#elif NETCOREAPP2_1 - "netcoreapp2.1"; -#elif NET461 -#error Tests targeting CLR must be compiled only on desktop. -#else -#error Target frameworks need to be updated. -#endif - testName = $"{testName}_{serverType}_{runtimeFlavor}_{architecture}_{applicationType}"; using (StartLog(out var loggerFactory, testName)) { @@ -181,7 +166,7 @@ namespace ServerComparison.FunctionalTests EnvironmentName = "Responses", ServerConfigTemplateContent = Helpers.GetConfigContent(serverType, "Http.config", "nginx.conf"), SiteName = "HttpTestSite", // This is configured in the Http.config - TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net461" : "netcoreapp2.0", + TargetFramework = Helpers.GetTargetFramework(runtimeFlavor), ApplicationType = applicationType };