Switch IIS tests to Hosted queue (#6746)

This commit is contained in:
Pavel Krymets 2019-01-16 11:47:52 -08:00 committed by GitHub
parent 1bd5845b4c
commit 6cac028716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 9 deletions

View File

@ -75,6 +75,7 @@ jobs:
pool:
${{ if ne(parameters.poolName, '') }}:
name: ${{ parameters.poolName }}
vmImage: ${{ parameters.poolVmImage }}
${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'macOS')) }}:
name: Hosted macOS
vmImage: macOS-10.13

View File

@ -3,8 +3,10 @@ jobs:
parameters:
buildScript: ./build.cmd
buildArgs: "-ci -restore -build -test -projects src/Servers/IIS/**/*.csproj ${{ parameters.skipArgs }}"
poolName: "Hosted VS2017"
poolVmImage: "vs2017-win2016"
beforeBuild:
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1; & ./src/Servers/IIS/tools/SetupTestEnvironment.ps1 Setup"
- powershell: "& ./src/Servers/IIS/tools/InstallIISFeatures.ps1; & ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1; & ./src/Servers/IIS/tools/SetupTestEnvironment.ps1 Setup"
displayName: Prepare repo
afterBuild:
- powershell: "& ./src/Servers/IIS/tools/SetupTestEnvironment.ps1 Shutdown"

View File

@ -273,6 +273,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
}
[ConditionalFact]
[RequiresNewShim]
public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure()
{
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);

View File

@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
{
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator);
return principal.IsInRole(WindowsBuiltInRole.Administrator) || SkipInVSTSAttribute.RunningInVSTS;
}
}

View File

@ -10,7 +10,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
public sealed class SkipInVSTSAttribute : Attribute, ITestCondition
{
public bool IsMet => string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
public static bool RunningInVSTS = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
public bool IsMet => !RunningInVSTS;
public string SkipReason => "Running in VSTS";
}

View File

@ -47,13 +47,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
if (!principal.IsInRole(WindowsBuiltInRole.Administrator))
if (!principal.IsInRole(WindowsBuiltInRole.Administrator) && !SkipInVSTSAttribute.RunningInVSTS)
{
_skipReasonStatic += "The current console is not running as admin.";
return;
}
if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")))
if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS)
{
_skipReasonStatic += "The machine does not have IIS installed.";
return;
@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml");
if (!File.Exists(ancmConfigPath))
if (!File.Exists(ancmConfigPath) && !SkipInVSTSAttribute.RunningInVSTS)
{
_skipReasonStatic = "IIS Schema is not installed.";
return;
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
foreach (var module in Modules)
{
if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)))
if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
{
_modulesAvailable |= module.Capability;
}

View File

@ -26,7 +26,7 @@ namespace IIS.FunctionalTests
_fixture = fixture;
}
[ConditionalTheory]
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
[RequiresIIS(IISCapability.ApplicationInitialization)]
[InlineData(HostingModel.InProcess)]
[InlineData(HostingModel.OutOfProcess)]
@ -48,7 +48,7 @@ namespace IIS.FunctionalTests
}
}
[ConditionalTheory]
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
[RequiresIIS(IISCapability.ApplicationInitialization)]
[InlineData(HostingModel.InProcess)]
[InlineData(HostingModel.OutOfProcess)]

View File

@ -0,0 +1,7 @@
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebSockets
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WindowsAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CustomLogging
Enable-WindowsOptionalFeature -Online -FeatureName IIS-BasicAuthentication
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpTracing
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionDynamic