Enable IISExpress tests

This commit is contained in:
John Luo 2016-03-23 16:46:14 -07:00
parent 6c8b1f2ac3
commit 514d752959
10 changed files with 1060 additions and 35 deletions

View File

@ -8,7 +8,7 @@ namespace MusicStore
{
var host = new WebHostBuilder()
.UseDefaultHostingConfiguration(args)
.UseIISPlatformHandlerUrl()
.UseIIS()
.UseStartup("MusicStore")
.Build();

View File

@ -17,7 +17,6 @@
"../../shared/**/*.cs"
],
"tools": {
"dotnet-publish-iis": "1.0.0-*",
"dotnet-razor-tooling": "1.0.0-*"
},
"content": [
@ -37,9 +36,9 @@
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-*",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*",
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNetCore.Server.WebListener": "0.1.0-*",
"Microsoft.AspNetCore.Session": "1.0.0-*",
@ -69,10 +68,5 @@
"portable-net451+win8"
]
}
},
"scripts": {
"postpublish": [
"dotnet publish-iis --publish-folder %publish:OutputPath%"
]
}
}

View File

@ -1,12 +1,9 @@
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<appSettings>
<!-- This will turn on detailed errors when deployed to remote servers -->
<!-- This setting is not recommended for production -->
<add key="ASPNET_DETAILED_ERRORS" value="true" />
</appSettings>
<system.webServer>
<aspNetCore forwardWindowsAuthToken="true" processPath="../MusicStore.exe" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout.log" />
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
</system.webServer>
</configuration>

1029
test/E2ETests/Http.config Normal file

File diff suppressed because it is too large Load Diff

View File

@ -200,13 +200,7 @@ namespace E2ETests
private string PrefixBaseAddress(string url)
{
#if DNX451
url = _deploymentResult.DeploymentParameters.ServerType == ServerType.IIS ?
string.Format(url, new Uri(_deploymentResult.ApplicationBaseUri).Segments[1].TrimEnd('/')) :
string.Format(url, string.Empty);
#else
url = string.Format(url, string.Empty);
#endif
return url.Replace("//", "/").Replace("%2F%2F", "%2F").Replace("%2F/", "%2F");
}

View File

@ -118,6 +118,7 @@
</sectionGroup>
<section name="applicationInitialization" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
<section name="webSocket" overrideModeDefault="Deny" />
<section name="aspNetCore" overrideModeDefault="Allow" />
</sectionGroup>
</configSections>
@ -252,6 +253,7 @@
<add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness64" />
<add name="ManagedEngineV4.0_32bit" image="%windir%\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
<add name="ManagedEngineV4.0_64bit" image="%windir%\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
<add name="AspNetCoreModule" image="%SystemRoot%\system32\inetsrv\aspnetcore.dll" />
</globalModules>
<httpCompression directory="%TEMP%\iisexpress\IIS Temporary Compressed Files">
@ -926,6 +928,7 @@
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler,runtimeVersionv4.0" />
<add name="ScriptModule-4.0" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />
<add name="AspNetCoreModule" />
</modules>
<handlers accessPolicy="Read, Script">
<!-- <add name="WebDAV" path="*" verb="PROPFIND,PROPPATCH,MKCOL,PUT,COPY,DELETE,MOVE,LOCK,UNLOCK" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" /> -->

View File

@ -26,6 +26,7 @@ namespace E2ETests
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5050/")]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5051/")]
public async Task NtlmAuthenticationTest(ServerType serverType, RuntimeFlavor runtimeFlavor, RuntimeArchitecture architecture, string applicationBaseUrl)
{
using (_logger.BeginScope("NtlmAuthenticationTest"))
@ -35,7 +36,7 @@ namespace E2ETests
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(), serverType, runtimeFlavor, architecture)
{
PublishApplicationBeforeDeployment = true,
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5",
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net451" : "netstandardapp1.5",
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = "NtlmAuthentication", //Will pick the Start class named 'StartupNtlmAuthentication'
ApplicationHostConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("NtlmAuthentation.config") : null,

View File

@ -63,7 +63,7 @@ namespace E2ETests
var deploymentParameters = new DeploymentParameters(Helpers.GetApplicationPath(), serverType, runtimeFlavor, architecture)
{
PublishApplicationBeforeDeployment = true,
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5",
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net451" : "netstandardapp1.5",
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = "OpenIdConnectTesting",
UserAdditionalCleanup = parameters =>

View File

@ -139,7 +139,7 @@ namespace E2ETests
{
ApplicationBaseUriHint = applicationBaseUrl,
PublishApplicationBeforeDeployment = true,
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5",
PublishTargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net451" : "netstandardapp1.5",
UserAdditionalCleanup = parameters =>
{
DbUtils.DropDatabase(musicStoreDbName, _logger);

View File

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
@ -31,6 +32,8 @@ namespace E2ETests
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5002/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5003/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5004/")]
[InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5005/")]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x86, "http://localhost:5006/")]
public async Task WindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -43,7 +46,7 @@ namespace E2ETests
[ConditionalTheory(Skip = "Temporarily disabling test"), Trait("E2Etests", "Smoke")]
[OSSkipCondition(OperatingSystems.Windows)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5005/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5007/")]
public async Task NonWindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -72,10 +75,12 @@ namespace E2ETests
[ConditionalTheory, Trait("E2Etests", "Smoke")]
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
//[InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5006/")]
//[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5007/")]
//[InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5008/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5009/")]
[InlineData(ServerType.WebListener, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5008/")]
[InlineData(ServerType.WebListener, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5009/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5010/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5011/")]
[InlineData(ServerType.IISExpress, RuntimeFlavor.Clr, RuntimeArchitecture.x64, "http://localhost:5012/")]
[InlineData(ServerType.IISExpress, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5013/")]
public async Task WindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -88,7 +93,7 @@ namespace E2ETests
[ConditionalTheory, Trait("E2Etests", "Smoke")]
[OSSkipCondition(OperatingSystems.Windows)]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5011/")]
[InlineData(ServerType.Kestrel, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5014/")]
public async Task NonWindowsOS(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -118,8 +123,8 @@ namespace E2ETests
[OSSkipCondition(OperatingSystems.Linux)]
[SkipIfCurrentRuntimeIsCoreClr]
[SkipIfIISVariationsNotEnabled]
//[InlineData(ServerType.IIS, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5012/")]
[InlineData(ServerType.IIS, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5013/")]
//[InlineData(ServerType.IIS, RuntimeFlavor.Clr, RuntimeArchitecture.x86, "http://localhost:5015/")]
[InlineData(ServerType.IIS, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64, "http://localhost:5016/")]
public async Task SmokeTestSuite_On_IIS_X86(
ServerType serverType,
RuntimeFlavor runtimeFlavor,
@ -162,8 +167,10 @@ namespace E2ETests
{
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = "SocialTesting",
ApplicationHostConfigTemplateContent = (serverType == ServerType.IISExpress) ? File.ReadAllText("Http.config") : null,
SiteName = "MusicStoreTestSite",
PublishApplicationBeforeDeployment = true,
PublishTargetFramework = donetFlavor == RuntimeFlavor.Clr ? "dnx451" : "netstandardapp1.5",
PublishTargetFramework = donetFlavor == RuntimeFlavor.Clr ? "net451" : "netstandardapp1.5",
UserAdditionalCleanup = parameters =>
{
DbUtils.DropDatabase(musicStoreDbName, _logger);