From 9ccc896b1d85d601155454a7335cd04ab693b303 Mon Sep 17 00:00:00 2001 From: Chris R Date: Wed, 23 Nov 2016 13:38:24 -0800 Subject: [PATCH] #297 Standardize the test site layout, use the publish tool --- IISIntegration.sln | 4 ++-- samples/IISSample/project.json | 6 ++++++ samples/IISSample/web.config | 2 -- .../HelloWorldTest.cs | 8 ++++---- .../Helpers.cs | 2 +- .../HttpsTest.cs | 7 ++++--- .../NtlmAuthentationTest.cs | 5 +++-- test/TestSites.Portable/web.config | 11 ---------- .../Program.cs | 4 ++-- .../Properties/launchSettings.json | 0 .../TestSites.Standalone.xproj} | 4 ++-- .../project.json | 20 +++++++++++++++---- test/TestSites.Standalone/web.config | 9 +++++++++ test/TestSites/TestSites.xproj | 9 ++++----- test/TestSites/project.json | 18 ++++++++--------- test/TestSites/web.config | 4 +--- 16 files changed, 63 insertions(+), 50 deletions(-) delete mode 100644 test/TestSites.Portable/web.config rename test/{TestSites.Portable => TestSites.Standalone}/Program.cs (85%) rename test/{TestSites => TestSites.Standalone}/Properties/launchSettings.json (100%) rename test/{TestSites.Portable/TestSites.Portable.xproj => TestSites.Standalone/TestSites.Standalone.xproj} (92%) rename test/{TestSites.Portable => TestSites.Standalone}/project.json (62%) create mode 100644 test/TestSites.Standalone/web.config diff --git a/IISIntegration.sln b/IISIntegration.sln index 2c855fdda8..c5d2ae8315 100644 --- a/IISIntegration.sln +++ b/IISIntegration.sln @@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{EF30B533-D715-421A-92B7-92FEF460AC9C}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestSites", "test\TestSites\TestSites.xproj", "{E27453AD-9CA0-49A2-94FA-96337D77677D}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestSites.Standalone", "test\TestSites.Standalone\TestSites.Standalone.xproj", "{E27453AD-9CA0-49A2-94FA-96337D77677D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{C74B8F36-FD2F-45C9-9B8A-00E7CF0126A9}" EndProject @@ -24,7 +24,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Server.IISIntegration.Tests", "test\Microsoft.AspNetCore.Server.IISIntegration.Tests\Microsoft.AspNetCore.Server.IISIntegration.Tests.xproj", "{4106DB10-E09F-480E-9CE6-B39235512EE6}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestSites.Portable", "test\TestSites.Portable\TestSites.Portable.xproj", "{F54715C3-88D8-49E3-A291-C13570FE81FC}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestSites", "test\TestSites\TestSites.xproj", "{F54715C3-88D8-49E3-A291-C13570FE81FC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/samples/IISSample/project.json b/samples/IISSample/project.json index 34447e1369..cf7fb4383f 100644 --- a/samples/IISSample/project.json +++ b/samples/IISSample/project.json @@ -23,5 +23,11 @@ "include": [ "web.config" ] + }, + "tools": { + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-*" + }, + "scripts": { + "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" } } \ No newline at end of file diff --git a/samples/IISSample/web.config b/samples/IISSample/web.config index 709127863a..710f1d6a23 100644 --- a/samples/IISSample/web.config +++ b/samples/IISSample/web.config @@ -2,8 +2,6 @@ - - diff --git a/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/HelloWorldTest.cs b/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/HelloWorldTest.cs index bc576421bc..f20213f60d 100644 --- a/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/HelloWorldTest.cs +++ b/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/HelloWorldTest.cs @@ -19,9 +19,9 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] - //[InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5061/", ServerType.Kestrel, ApplicationType.Standalone)] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5062/", ServerType.Kestrel, ApplicationType.Standalone)] - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5063/", ServerType.Kestrel, ApplicationType.Standalone)] + //[InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5061/", ServerType.Kestrel, ApplicationType.Portable)] + [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5062/", ServerType.Kestrel, ApplicationType.Portable)] + //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5063/", ServerType.Kestrel, ApplicationType.Portable)] [InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5064/", ServerType.Kestrel, ApplicationType.Standalone)] [InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5065/", ServerType.Kestrel, ApplicationType.Portable)] public Task HelloWorld_IISExpress(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ServerType delegateServer, ApplicationType applicationType) @@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] [SkipIfCurrentRuntimeIsCoreClr] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5069/", ServerType.Kestrel, ApplicationType.Standalone)] + [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5069/", ServerType.Kestrel, ApplicationType.Portable)] //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5070/", ServerType.Kestrel, ApplicationType.Standalone)] public Task HelloWorld_IIS(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ServerType delegateServer, ApplicationType applicationType) { diff --git a/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/Helpers.cs b/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/Helpers.cs index 78623c09b5..2108aee858 100644 --- a/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/Helpers.cs +++ b/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/Helpers.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests { public static string GetTestSitesPath(ApplicationType applicationType) { - return Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", applicationType == ApplicationType.Standalone ? "TestSites" : "TestSites.Portable")); + return Path.GetFullPath(Path.Combine("..", "..", "..", "..", "..", applicationType == ApplicationType.Standalone ? "TestSites.Standalone" : "TestSites")); } } } \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/HttpsTest.cs b/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/HttpsTest.cs index d75ad7060c..61800e3a3a 100644 --- a/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/HttpsTest.cs +++ b/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/HttpsTest.cs @@ -20,8 +20,9 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalTheory] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] - //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "https://localhost:44395/", ApplicationType.Standalone)] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "https://localhost:44396/", ApplicationType.Standalone)] + //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "https://localhost:44394/", ApplicationType.Portable)] + [InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "https://localhost:44395/", ApplicationType.Standalone)] + [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "https://localhost:44396/", ApplicationType.Portable)] public Task Https_HelloWorld(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return HttpsHelloWorld(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType); @@ -93,7 +94,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] //[InlineData(RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "https://localhost:44400/", ApplicationType.Standalone)] - [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "https://localhost:44401/", ApplicationType.Standalone)] + [InlineData(RuntimeFlavor.Clr, RuntimeArchitecture.x64, "https://localhost:44401/", ApplicationType.Portable)] public Task Https_HelloWorld_ClientCert(RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { return HttpsHelloWorldCerts(ServerType.IISExpress, runtimeFlavor, architecture, applicationBaseUrl, applicationType, sendClientCert: true); diff --git a/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/NtlmAuthentationTest.cs b/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/NtlmAuthentationTest.cs index 8b74871914..958bfb2b58 100644 --- a/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/NtlmAuthentationTest.cs +++ b/test/Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests/NtlmAuthentationTest.cs @@ -21,13 +21,14 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] //[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5050/", ApplicationType.Standalone)] - [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5051/", ApplicationType.Standalone)] + [InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5051/", ApplicationType.Portable)] + [InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5052/", ApplicationType.Standalone)] public async Task NtlmAuthentication(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl, ApplicationType applicationType) { var logger = new LoggerFactory() .AddConsole() .AddDebug() - .CreateLogger($"HttpsHelloWorld:{serverType}:{runtimeFlavor}:{architecture}"); + .CreateLogger($"NtlmAuthentication:{serverType}:{runtimeFlavor}:{architecture}"); using (logger.BeginScope("NtlmAuthenticationTest")) { diff --git a/test/TestSites.Portable/web.config b/test/TestSites.Portable/web.config deleted file mode 100644 index 5081ed4b68..0000000000 --- a/test/TestSites.Portable/web.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/test/TestSites.Portable/Program.cs b/test/TestSites.Standalone/Program.cs similarity index 85% rename from test/TestSites.Portable/Program.cs rename to test/TestSites.Standalone/Program.cs index 181b270b0d..a20e9fc4a3 100644 --- a/test/TestSites.Portable/Program.cs +++ b/test/TestSites.Standalone/Program.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Hosting; -namespace TestSites.Portable +namespace TestSites.Standalone { public static class Program { @@ -11,7 +11,7 @@ namespace TestSites.Portable { var host = new WebHostBuilder() .UseIISIntegration() - .UseStartup("TestSites.Portable") + .UseStartup("TestSites.Standalone") .UseKestrel() .Build(); diff --git a/test/TestSites/Properties/launchSettings.json b/test/TestSites.Standalone/Properties/launchSettings.json similarity index 100% rename from test/TestSites/Properties/launchSettings.json rename to test/TestSites.Standalone/Properties/launchSettings.json diff --git a/test/TestSites.Portable/TestSites.Portable.xproj b/test/TestSites.Standalone/TestSites.Standalone.xproj similarity index 92% rename from test/TestSites.Portable/TestSites.Portable.xproj rename to test/TestSites.Standalone/TestSites.Standalone.xproj index 477f1c67dd..5e32a0742c 100644 --- a/test/TestSites.Portable/TestSites.Portable.xproj +++ b/test/TestSites.Standalone/TestSites.Standalone.xproj @@ -6,7 +6,7 @@ - f54715c3-88d8-49e3-a291-c13570fe81fc + e27453ad-9ca0-49a2-94fa-96337d77677d .\obj .\bin\ @@ -14,4 +14,4 @@ 2.0 - + \ No newline at end of file diff --git a/test/TestSites.Portable/project.json b/test/TestSites.Standalone/project.json similarity index 62% rename from test/TestSites.Portable/project.json rename to test/TestSites.Standalone/project.json index c0368740d1..3c472cae9c 100644 --- a/test/TestSites.Portable/project.json +++ b/test/TestSites.Standalone/project.json @@ -24,11 +24,23 @@ "frameworks": { "netcoreapp1.1": { "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.1.0-*", - "type": "platform" - } + "Microsoft.NETCore.App": "1.1.0-*" } } + }, + "tools": { + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-*" + }, + "scripts": { + "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" + }, + "runtimes": { + "win7-x64": {}, + "win7-x86": {}, + "osx.10.10-x64": {}, + "osx.10.11-x64": {}, + "osx.10.12-x64": {}, + "ubuntu.14.04-x64": {}, + "ubuntu.15.04-x64": {} } } \ No newline at end of file diff --git a/test/TestSites.Standalone/web.config b/test/TestSites.Standalone/web.config new file mode 100644 index 0000000000..d889af8ba3 --- /dev/null +++ b/test/TestSites.Standalone/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/test/TestSites/TestSites.xproj b/test/TestSites/TestSites.xproj index 8a932146f7..477f1c67dd 100644 --- a/test/TestSites/TestSites.xproj +++ b/test/TestSites/TestSites.xproj @@ -4,15 +4,14 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + - e27453ad-9ca0-49a2-94fa-96337d77677d + f54715c3-88d8-49e3-a291-c13570fe81fc .\obj .\bin\ 2.0 - 11738 - - \ No newline at end of file + + diff --git a/test/TestSites/project.json b/test/TestSites/project.json index b7c69d413e..52ff9df325 100644 --- a/test/TestSites/project.json +++ b/test/TestSites/project.json @@ -21,18 +21,18 @@ "frameworks": { "netcoreapp1.1": { "dependencies": { - "Microsoft.NETCore.App": "1.1.0-*" + "Microsoft.NETCore.App": { + "version": "1.1.0-*", + "type": "platform" + } } }, "net451": {} }, - "runtimes": { - "win7-x64": {}, - "win7-x86": {}, - "osx.10.10-x64": {}, - "osx.10.11-x64": {}, - "osx.10.12-x64": {}, - "ubuntu.14.04-x64": {}, - "ubuntu.15.04-x64": {} + "tools": { + "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-*" + }, + "scripts": { + "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" } } \ No newline at end of file diff --git a/test/TestSites/web.config b/test/TestSites/web.config index 757f29add2..d889af8ba3 100644 --- a/test/TestSites/web.config +++ b/test/TestSites/web.config @@ -1,11 +1,9 @@  - - - + \ No newline at end of file