Switch IIS tests to Hosted queue (#6746)
This commit is contained in:
parent
1bd5845b4c
commit
6cac028716
|
|
@ -75,6 +75,7 @@ jobs:
|
||||||
pool:
|
pool:
|
||||||
${{ if ne(parameters.poolName, '') }}:
|
${{ if ne(parameters.poolName, '') }}:
|
||||||
name: ${{ parameters.poolName }}
|
name: ${{ parameters.poolName }}
|
||||||
|
vmImage: ${{ parameters.poolVmImage }}
|
||||||
${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'macOS')) }}:
|
${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'macOS')) }}:
|
||||||
name: Hosted macOS
|
name: Hosted macOS
|
||||||
vmImage: macOS-10.13
|
vmImage: macOS-10.13
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,10 @@ jobs:
|
||||||
parameters:
|
parameters:
|
||||||
buildScript: ./build.cmd
|
buildScript: ./build.cmd
|
||||||
buildArgs: "-ci -restore -build -test -projects src/Servers/IIS/**/*.csproj ${{ parameters.skipArgs }}"
|
buildArgs: "-ci -restore -build -test -projects src/Servers/IIS/**/*.csproj ${{ parameters.skipArgs }}"
|
||||||
|
poolName: "Hosted VS2017"
|
||||||
|
poolVmImage: "vs2017-win2016"
|
||||||
beforeBuild:
|
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
|
displayName: Prepare repo
|
||||||
afterBuild:
|
afterBuild:
|
||||||
- powershell: "& ./src/Servers/IIS/tools/SetupTestEnvironment.ps1 Shutdown"
|
- powershell: "& ./src/Servers/IIS/tools/SetupTestEnvironment.ps1 Shutdown"
|
||||||
|
|
|
||||||
|
|
@ -273,6 +273,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalFact]
|
[ConditionalFact]
|
||||||
|
[RequiresNewShim]
|
||||||
public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure()
|
public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure()
|
||||||
{
|
{
|
||||||
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
{
|
{
|
||||||
var identity = WindowsIdentity.GetCurrent();
|
var identity = WindowsIdentity.GetCurrent();
|
||||||
var principal = new WindowsPrincipal(identity);
|
var principal = new WindowsPrincipal(identity);
|
||||||
return principal.IsInRole(WindowsBuiltInRole.Administrator);
|
return principal.IsInRole(WindowsBuiltInRole.Administrator) || SkipInVSTSAttribute.RunningInVSTS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
|
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
|
||||||
public sealed class SkipInVSTSAttribute : Attribute, ITestCondition
|
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";
|
public string SkipReason => "Running in VSTS";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,13 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
var identity = WindowsIdentity.GetCurrent();
|
var identity = WindowsIdentity.GetCurrent();
|
||||||
var principal = new WindowsPrincipal(identity);
|
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.";
|
_skipReasonStatic += "The current console is not running as admin.";
|
||||||
return;
|
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.";
|
_skipReasonStatic += "The machine does not have IIS installed.";
|
||||||
return;
|
return;
|
||||||
|
|
@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml");
|
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.";
|
_skipReasonStatic = "IIS Schema is not installed.";
|
||||||
return;
|
return;
|
||||||
|
|
@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
|
||||||
|
|
||||||
foreach (var module in Modules)
|
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;
|
_modulesAvailable |= module.Capability;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace IIS.FunctionalTests
|
||||||
_fixture = fixture;
|
_fixture = fixture;
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
|
||||||
[RequiresIIS(IISCapability.ApplicationInitialization)]
|
[RequiresIIS(IISCapability.ApplicationInitialization)]
|
||||||
[InlineData(HostingModel.InProcess)]
|
[InlineData(HostingModel.InProcess)]
|
||||||
[InlineData(HostingModel.OutOfProcess)]
|
[InlineData(HostingModel.OutOfProcess)]
|
||||||
|
|
@ -48,7 +48,7 @@ namespace IIS.FunctionalTests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConditionalTheory]
|
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
|
||||||
[RequiresIIS(IISCapability.ApplicationInitialization)]
|
[RequiresIIS(IISCapability.ApplicationInitialization)]
|
||||||
[InlineData(HostingModel.InProcess)]
|
[InlineData(HostingModel.InProcess)]
|
||||||
[InlineData(HostingModel.OutOfProcess)]
|
[InlineData(HostingModel.OutOfProcess)]
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue