Skip to content

Commit 6cac028

Browse files
authored
Switch IIS tests to Hosted queue (#6746)
1 parent 1bd5845 commit 6cac028

File tree

8 files changed

+21
-9
lines changed

8 files changed

+21
-9
lines changed

.azure/pipelines/jobs/default-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
pool:
7676
${{ if ne(parameters.poolName, '') }}:
7777
name: ${{ parameters.poolName }}
78+
vmImage: ${{ parameters.poolVmImage }}
7879
${{ if and(eq(parameters.poolName, ''), eq(parameters.agentOs, 'macOS')) }}:
7980
name: Hosted macOS
8081
vmImage: macOS-10.13

.azure/pipelines/jobs/iisintegration-job.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ jobs:
33
parameters:
44
buildScript: ./build.cmd
55
buildArgs: "-ci -restore -build -test -projects src/Servers/IIS/**/*.csproj ${{ parameters.skipArgs }}"
6+
poolName: "Hosted VS2017"
7+
poolVmImage: "vs2017-win2016"
68
beforeBuild:
7-
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1; & ./src/Servers/IIS/tools/SetupTestEnvironment.ps1 Setup"
9+
- 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"
810
displayName: Prepare repo
911
afterBuild:
1012
- powershell: "& ./src/Servers/IIS/tools/SetupTestEnvironment.ps1 Shutdown"

src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ public async Task RemoveHostfxrFromApp_InProcessHostfxrAPIAbsent()
273273
}
274274

275275
[ConditionalFact]
276+
[RequiresNewShim]
276277
public async Task RemoveHostfxrFromApp_InProcessHostfxrLoadFailure()
277278
{
278279
var deploymentParameters = _fixture.GetBaseDeploymentParameters(_fixture.InProcessTestSite, publish: true);

src/Servers/IIS/IIS/test/Common.FunctionalTests/SkipIfNotAdminAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public bool IsMet
1616
{
1717
var identity = WindowsIdentity.GetCurrent();
1818
var principal = new WindowsPrincipal(identity);
19-
return principal.IsInRole(WindowsBuiltInRole.Administrator);
19+
return principal.IsInRole(WindowsBuiltInRole.Administrator) || SkipInVSTSAttribute.RunningInVSTS;
2020
}
2121
}
2222

src/Servers/IIS/IIS/test/Common.FunctionalTests/SkipVSTSAttribute.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
1010
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
1111
public sealed class SkipInVSTSAttribute : Attribute, ITestCondition
1212
{
13-
public bool IsMet => string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
13+
public static bool RunningInVSTS = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
14+
public bool IsMet => !RunningInVSTS;
1415

1516
public string SkipReason => "Running in VSTS";
1617
}

src/Servers/IIS/IIS/test/IIS.Shared.FunctionalTests/RequiresIISAttribute.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ static RequiresIISAttribute()
4747

4848
var identity = WindowsIdentity.GetCurrent();
4949
var principal = new WindowsPrincipal(identity);
50-
if (!principal.IsInRole(WindowsBuiltInRole.Administrator))
50+
if (!principal.IsInRole(WindowsBuiltInRole.Administrator) && !SkipInVSTSAttribute.RunningInVSTS)
5151
{
5252
_skipReasonStatic += "The current console is not running as admin.";
5353
return;
5454
}
5555

56-
if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")))
56+
if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS)
5757
{
5858
_skipReasonStatic += "The machine does not have IIS installed.";
5959
return;
6060
}
6161

6262
var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml");
6363

64-
if (!File.Exists(ancmConfigPath))
64+
if (!File.Exists(ancmConfigPath) && !SkipInVSTSAttribute.RunningInVSTS)
6565
{
6666
_skipReasonStatic = "IIS Schema is not installed.";
6767
return;
@@ -88,7 +88,7 @@ static RequiresIISAttribute()
8888

8989
foreach (var module in Modules)
9090
{
91-
if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)))
91+
if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
9292
{
9393
_modulesAvailable |= module.Capability;
9494
}

src/Servers/IIS/IIS/test/IIS.Shared.FunctionalTests/ServicesTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public ApplicationInitializationTests(PublishedSitesFixture fixture)
2626
_fixture = fixture;
2727
}
2828

29-
[ConditionalTheory]
29+
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
3030
[RequiresIIS(IISCapability.ApplicationInitialization)]
3131
[InlineData(HostingModel.InProcess)]
3232
[InlineData(HostingModel.OutOfProcess)]
@@ -48,7 +48,7 @@ public async Task ApplicationPreloadStartsApp(HostingModel hostingModel)
4848
}
4949
}
5050

51-
[ConditionalTheory]
51+
[ConditionalTheory(Skip="https://github.com/aspnet/AspNetCore/issues/6752")]
5252
[RequiresIIS(IISCapability.ApplicationInitialization)]
5353
[InlineData(HostingModel.InProcess)]
5454
[InlineData(HostingModel.OutOfProcess)]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebSockets
2+
Enable-WindowsOptionalFeature -Online -FeatureName IIS-WindowsAuthentication
3+
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit
4+
Enable-WindowsOptionalFeature -Online -FeatureName IIS-CustomLogging
5+
Enable-WindowsOptionalFeature -Online -FeatureName IIS-BasicAuthentication
6+
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpTracing
7+
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpCompressionDynamic

0 commit comments

Comments
 (0)