From 5ff734bb71c0335068f79846731b3183bb1e1b87 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Thu, 9 Mar 2017 10:37:38 -0800 Subject: [PATCH] [Fixes #53] Enable skipped Standalone tests --- ServerTests.sln | 9 +-- .../HelloWorldTest.cs | 12 +++- .../Helpers.cs | 9 +-- .../NtlmAuthenticationTest.cs | 12 +++- .../ResponseCompressionTests.cs | 24 +++++--- .../ResponseTests.cs | 24 +++++--- .../ServerComparison.FunctionalTests.csproj | 7 ++- .../Program.cs | 57 ------------------- .../Properties/launchSettings.json | 22 ------- ...rverComparison.TestSites.Standalone.csproj | 28 --------- .../web.config | 9 --- .../ServerComparison.TestSites.csproj | 9 ++- 12 files changed, 64 insertions(+), 158 deletions(-) delete mode 100644 test/ServerComparison.TestSites.Standalone/Program.cs delete mode 100644 test/ServerComparison.TestSites.Standalone/Properties/launchSettings.json delete mode 100644 test/ServerComparison.TestSites.Standalone/ServerComparison.TestSites.Standalone.csproj delete mode 100644 test/ServerComparison.TestSites.Standalone/web.config diff --git a/ServerTests.sln b/ServerTests.sln index 7e1140fbe8..2cc850dac2 100644 --- a/ServerTests.sln +++ b/ServerTests.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26131.1 +VisualStudioVersion = 15.0.26228.4 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{49AB8AAA-8160-48DF-A18B-78F51E54E02A}" ProjectSection(SolutionItems) = preProject @@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerComparison.Functional EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerComparison.TestSites", "test\ServerComparison.TestSites\ServerComparison.TestSites.csproj", "{030225D8-4EE8-47E5-B692-2A96B3B51A38}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ServerComparison.TestSites.Standalone", "test\ServerComparison.TestSites.Standalone\ServerComparison.TestSites.Standalone.csproj", "{A7C46DF3-0A33-4919-A22C-1C8AFFADC0BE}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -29,10 +27,6 @@ Global {030225D8-4EE8-47E5-B692-2A96B3B51A38}.Debug|Any CPU.Build.0 = Debug|Any CPU {030225D8-4EE8-47E5-B692-2A96B3B51A38}.Release|Any CPU.ActiveCfg = Release|Any CPU {030225D8-4EE8-47E5-B692-2A96B3B51A38}.Release|Any CPU.Build.0 = Release|Any CPU - {A7C46DF3-0A33-4919-A22C-1C8AFFADC0BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7C46DF3-0A33-4919-A22C-1C8AFFADC0BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7C46DF3-0A33-4919-A22C-1C8AFFADC0BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A7C46DF3-0A33-4919-A22C-1C8AFFADC0BE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -40,6 +34,5 @@ Global GlobalSection(NestedProjects) = preSolution {A319ACCE-060B-4385-9534-9F2202F6180E} = {FA91F388-F4AF-4850-9D68-D4D128E6B1A6} {030225D8-4EE8-47E5-B692-2A96B3B51A38} = {FA91F388-F4AF-4850-9D68-D4D128E6B1A6} - {A7C46DF3-0A33-4919-A22C-1C8AFFADC0BE} = {FA91F388-F4AF-4850-9D68-D4D128E6B1A6} EndGlobalSection EndGlobal diff --git a/test/ServerComparison.FunctionalTests/HelloWorldTest.cs b/test/ServerComparison.FunctionalTests/HelloWorldTest.cs index db1ce60a49..764b32ed0e 100644 --- a/test/ServerComparison.FunctionalTests/HelloWorldTest.cs +++ b/test/ServerComparison.FunctionalTests/HelloWorldTest.cs @@ -6,6 +6,7 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; +using Microsoft.DotNet.PlatformAbstractions; using Microsoft.Extensions.Logging; using Xunit; using Xunit.Sdk; @@ -23,7 +24,7 @@ namespace ServerComparison.FunctionalTests [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5062/", ApplicationType.Portable)] //[InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5063/", ApplicationType.Portable)] [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5064/", ApplicationType.Portable)] - //[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5065/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5065/", ApplicationType.Standalone)] [InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5066/", ApplicationType.Portable)] public Task HelloWorld_Windows(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { @@ -33,7 +34,7 @@ namespace ServerComparison.FunctionalTests [Theory] //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5067/", ApplicationType.Portable)] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5068/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5069/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5069/", ApplicationType.Standalone)] public Task HelloWorld_Kestrel(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return HelloWorld(serverType, runtimeFlavor, architecture, applicationBaseUrl, applicationType); @@ -42,7 +43,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Windows)] [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5070/", ApplicationType.Portable)] - //[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5071/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5071/", ApplicationType.Standalone)] public Task HelloWorld_Nginx(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return HelloWorld(serverType, runtimeFlavor, architecture, applicationBaseUrl, applicationType); @@ -78,6 +79,11 @@ namespace ServerComparison.FunctionalTests ApplicationType = applicationType }; + if(applicationType == ApplicationType.Standalone) + { + deploymentParameters.AdditionalPublishParameters = " -r " + RuntimeEnvironment.GetRuntimeIdentifier(); + } + using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, logger)) { var deploymentResult = deployer.Deploy(); diff --git a/test/ServerComparison.FunctionalTests/Helpers.cs b/test/ServerComparison.FunctionalTests/Helpers.cs index 84a3cefd69..aff2fb1b86 100644 --- a/test/ServerComparison.FunctionalTests/Helpers.cs +++ b/test/ServerComparison.FunctionalTests/Helpers.cs @@ -20,8 +20,7 @@ namespace ServerComparison.FunctionalTests var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "ServerTests.sln")); if (solutionFileInfo.Exists) { - var projectName = applicationType == ApplicationType.Standalone ? "ServerComparison.TestSites.Standalone" : "ServerComparison.TestSites"; - return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "test", projectName)); + return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "test", "ServerComparison.TestSites")); } directoryInfo = directoryInfo.Parent; @@ -33,14 +32,16 @@ namespace ServerComparison.FunctionalTests public static string GetConfigContent(ServerType serverType, string iisConfig, string nginxConfig) { + var applicationBasePath = PlatformServices.Default.Application.ApplicationBasePath; + string content = null; if (serverType == ServerType.IISExpress) { - content = File.ReadAllText(iisConfig); + content = File.ReadAllText(Path.Combine(applicationBasePath, iisConfig)); } else if (serverType == ServerType.Nginx) { - content = File.ReadAllText(nginxConfig); + content = File.ReadAllText(Path.Combine(applicationBasePath, nginxConfig)); } return content; diff --git a/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs b/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs index 3b19f5e1c6..a3ca9abe81 100644 --- a/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs +++ b/test/ServerComparison.FunctionalTests/NtlmAuthenticationTest.cs @@ -8,6 +8,7 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; +using Microsoft.DotNet.PlatformAbstractions; using Microsoft.Extensions.Logging; using Xunit; using Xunit.Sdk; @@ -25,7 +26,7 @@ namespace ServerComparison.FunctionalTests // [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5051/", ApplicationType.Portable)] // [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5052/", ApplicationType.Portable)] [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5052/", ApplicationType.Portable)] - //[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5053/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5053/", ApplicationType.Standalone)] public async Task NtlmAuthentication(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { var logger = new LoggerFactory() @@ -40,10 +41,15 @@ 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 - ApplicationType = applicationType, - TargetFramework = "net452", + TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net452" : "netcoreapp1.1", + ApplicationType = applicationType }; + if(applicationType == ApplicationType.Standalone) + { + deploymentParameters.AdditionalPublishParameters = " -r " + RuntimeEnvironment.GetRuntimeIdentifier(); + } + using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, logger)) { var deploymentResult = deployer.Deploy(); diff --git a/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs b/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs index cf1a2402cb..f1fcd86a70 100644 --- a/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs +++ b/test/ServerComparison.FunctionalTests/ResponseCompressionTests.cs @@ -11,6 +11,7 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; +using Microsoft.DotNet.PlatformAbstractions; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; using Xunit; @@ -36,7 +37,7 @@ namespace ServerComparison.FunctionalTests [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5102/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5103/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5103/", ApplicationType.Standalone)] public Task ResponseCompression_Kestrel_NoCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseCompression(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckNoCompressionAsync, applicationType, hostCompression: false); @@ -45,7 +46,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Windows)] [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5103/", ApplicationType.Portable)] - //[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5104/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5104/", ApplicationType.Standalone)] public Task ResponseCompression_Nginx_NoCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseCompression(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckNoCompressionAsync, applicationType, hostCompression: false); @@ -55,7 +56,7 @@ namespace ServerComparison.FunctionalTests [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5105/", ApplicationType.Portable)] - //[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5106/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5106/", ApplicationType.Standalone)] public Task ResponseCompression_Windows_HostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseCompression(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckHostCompressionAsync, applicationType, hostCompression: true); @@ -64,7 +65,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Windows)] [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5107/", ApplicationType.Portable)] - //[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5108/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5108/", ApplicationType.Standalone)] public Task ResponseCompression_Nginx_HostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseCompression(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckHostCompressionAsync, applicationType, hostCompression: true); @@ -73,7 +74,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] - //[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5109/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5109/", ApplicationType.Standalone)] [InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5110/", ApplicationType.Portable)] public Task ResponseCompression_Windows_AppCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { @@ -82,7 +83,7 @@ namespace ServerComparison.FunctionalTests [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5111/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5112/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5112/", ApplicationType.Standalone)] public Task ResponseCompression_Kestrel_AppCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseCompression(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckAppCompressionAsync, applicationType, hostCompression: false); @@ -91,7 +92,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory(Skip = "No pass-through compression https://github.com/aspnet/BasicMiddleware/issues/123")] [OSSkipCondition(OperatingSystems.Windows)] [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5113/", ApplicationType.Portable)] - //[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5114/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5114/", ApplicationType.Standalone)] public Task ResponseCompression_Nginx_AppCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseCompression(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckHostCompressionAsync, applicationType, hostCompression: false); @@ -100,7 +101,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] - //[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5115/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5115/", ApplicationType.Standalone)] [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5116/", ApplicationType.Portable)] public Task ResponseCompression_Windows_AppAndHostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { @@ -110,7 +111,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Windows)] [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5117/", ApplicationType.Portable)] - //[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5118/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5118/", ApplicationType.Standalone)] public Task ResponseCompression_Nginx_AppAndHostCompression(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseCompression(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckAppCompressionAsync, applicationType, hostCompression: true); @@ -136,6 +137,11 @@ namespace ServerComparison.FunctionalTests ApplicationType = applicationType }; + if (applicationType == ApplicationType.Standalone) + { + deploymentParameters.AdditionalPublishParameters = " -r " + RuntimeEnvironment.GetRuntimeIdentifier(); + } + using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, logger)) { var deploymentResult = deployer.Deploy(); diff --git a/test/ServerComparison.FunctionalTests/ResponseTests.cs b/test/ServerComparison.FunctionalTests/ResponseTests.cs index 40b1a0a8ed..0ef668f1e9 100644 --- a/test/ServerComparison.FunctionalTests/ResponseTests.cs +++ b/test/ServerComparison.FunctionalTests/ResponseTests.cs @@ -8,6 +8,7 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Server.IntegrationTesting; using Microsoft.AspNetCore.Testing.xunit; +using Microsoft.DotNet.PlatformAbstractions; using Microsoft.Extensions.Logging; using Microsoft.Net.Http.Headers; using Xunit; @@ -30,7 +31,7 @@ namespace ServerComparison.FunctionalTests [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5082/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5083/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5083/", ApplicationType.Standalone)] public Task ResponseFormats_Kestrel_ContentLength(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckContentLengthAsync, applicationType); @@ -39,7 +40,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Windows)] [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5084/", ApplicationType.Portable)] - //[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5085/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5085/", ApplicationType.Standalone)] public Task ResponseFormats_Nginx_ContentLength(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckContentLengthAsync, applicationType); @@ -67,7 +68,7 @@ namespace ServerComparison.FunctionalTests [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5088/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5089/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5089/", ApplicationType.Standalone)] public Task ResponseFormats_Kestrel_Http10ConnectionClose(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckHttp10ConnectionCloseAsync, applicationType); @@ -75,7 +76,7 @@ namespace ServerComparison.FunctionalTests [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5088/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5089/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5089/", ApplicationType.Standalone)] public Task ResponseFormats_Kestrel_Http11ConnectionClose(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckHttp11ConnectionCloseAsync, applicationType); @@ -93,7 +94,7 @@ namespace ServerComparison.FunctionalTests [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5092/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5093/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5093/", ApplicationType.Standalone)] public Task ResponseFormats_Kestrel_Chunked(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckChunkedAsync, applicationType); @@ -102,7 +103,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Windows)] [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5094/", ApplicationType.Portable)] - //[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5095/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5095/", ApplicationType.Standalone)] public Task ResponseFormats_Nginx_Chunked(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckChunkedAsync, applicationType); @@ -120,7 +121,7 @@ namespace ServerComparison.FunctionalTests [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5098/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5099/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5099/", ApplicationType.Standalone)] public Task ResponseFormats_Kestrel_ManuallyChunk(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckManuallyChunkedAsync, applicationType); @@ -129,7 +130,7 @@ namespace ServerComparison.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Windows)] [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5100/", ApplicationType.Portable)] - //[InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5101/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Nginx, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5101/", ApplicationType.Standalone)] public Task ResponseFormats_Nginx_ManuallyChunk(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckManuallyChunkedAsync, applicationType); @@ -147,7 +148,7 @@ namespace ServerComparison.FunctionalTests [Theory] [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5104/", ApplicationType.Portable)] - //[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5104/", ApplicationType.Standalone, Skip = "https://github.com/aspnet/ServerTests/issues/53")] + [InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5104/", ApplicationType.Standalone)] public Task ResponseFormats_Kestrel_ManuallyChunkAndClose(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return ResponseFormats(serverType, runtimeFlavor, architecture, applicationBaseUrl, CheckManuallyChunkedAndCloseAsync, applicationType); @@ -171,6 +172,11 @@ namespace ServerComparison.FunctionalTests ApplicationType = applicationType }; + if (applicationType == ApplicationType.Standalone) + { + deploymentParameters.AdditionalPublishParameters = " -r " + RuntimeEnvironment.GetRuntimeIdentifier(); + } + using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, logger)) { var deploymentResult = deployer.Deploy(); diff --git a/test/ServerComparison.FunctionalTests/ServerComparison.FunctionalTests.csproj b/test/ServerComparison.FunctionalTests/ServerComparison.FunctionalTests.csproj index da278f0e3f..a0b3cbcddf 100644 --- a/test/ServerComparison.FunctionalTests/ServerComparison.FunctionalTests.csproj +++ b/test/ServerComparison.FunctionalTests/ServerComparison.FunctionalTests.csproj @@ -1,4 +1,4 @@ - + @@ -18,9 +18,14 @@ + + + + + diff --git a/test/ServerComparison.TestSites.Standalone/Program.cs b/test/ServerComparison.TestSites.Standalone/Program.cs deleted file mode 100644 index bc5350dc78..0000000000 --- a/test/ServerComparison.TestSites.Standalone/Program.cs +++ /dev/null @@ -1,57 +0,0 @@ -// 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; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.HttpSys; -using Microsoft.Extensions.Configuration; - -namespace ServerComparison.TestSites.Standalone -{ - public static class Program - { - public static void Main(string[] args) - { - var config = new ConfigurationBuilder() - .AddCommandLine(args) - .Build(); - - var builder = new WebHostBuilder() - .UseConfiguration(config) - .UseIISIntegration() - .UseStartup("ServerComparison.TestSites.Standalone"); - - // Switch between Kestrel and WebListener for different tests. Default to Kestrel for normal app execution. - if (string.Equals(builder.GetSetting("server"), "Microsoft.AspNetCore.Server.HttpSys", System.StringComparison.Ordinal)) - { - if (string.Equals(builder.GetSetting("environment") ?? - Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"), - "NtlmAuthentication", System.StringComparison.Ordinal)) - { - // Set up NTLM authentication for WebListener as follows. - // For IIS and IISExpress use inetmgr to setup NTLM authentication on the application or - // modify the applicationHost.config to enable NTLM. - builder.UseHttpSys(options => - { - options.Authentication.AllowAnonymous = true; - options.Authentication.Schemes = - AuthenticationSchemes.Negotiate | AuthenticationSchemes.NTLM; - }); - } - else - { - builder.UseHttpSys(); - } - } - else - { - builder.UseKestrel(); - } - - var host = builder.Build(); - - host.Run(); - } - } -} - diff --git a/test/ServerComparison.TestSites.Standalone/Properties/launchSettings.json b/test/ServerComparison.TestSites.Standalone/Properties/launchSettings.json deleted file mode 100644 index 259a358046..0000000000 --- a/test/ServerComparison.TestSites.Standalone/Properties/launchSettings.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:3417/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "ServerComparison.TestSites.Standalone": { - "commandName": "Project" - } - } -} \ No newline at end of file diff --git a/test/ServerComparison.TestSites.Standalone/ServerComparison.TestSites.Standalone.csproj b/test/ServerComparison.TestSites.Standalone/ServerComparison.TestSites.Standalone.csproj deleted file mode 100644 index c3b32744af..0000000000 --- a/test/ServerComparison.TestSites.Standalone/ServerComparison.TestSites.Standalone.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - netcoreapp1.1 - Exe - - - - - - - - - - - - - - - - - - - - - diff --git a/test/ServerComparison.TestSites.Standalone/web.config b/test/ServerComparison.TestSites.Standalone/web.config deleted file mode 100644 index 3379e820ea..0000000000 --- a/test/ServerComparison.TestSites.Standalone/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/test/ServerComparison.TestSites/ServerComparison.TestSites.csproj b/test/ServerComparison.TestSites/ServerComparison.TestSites.csproj index 4ec1c2f3e7..96a27f5b6a 100644 --- a/test/ServerComparison.TestSites/ServerComparison.TestSites.csproj +++ b/test/ServerComparison.TestSites/ServerComparison.TestSites.csproj @@ -1,17 +1,16 @@ - + net452;netcoreapp1.1 netcoreapp1.1 - - win7-x64 + win7-x86;win7-x64;win10-x86;win10-x64;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.15.04-x64;centos.7-x64;rhel.7.2-x64 Exe - + @@ -26,5 +25,5 @@ - +