Skip to content

Commit d3e90a7

Browse files
authored
Guarantee that ANCM package dlls are used for back compat tests (#10858)
1 parent f080c89 commit d3e90a7

File tree

14 files changed

+22
-34
lines changed

14 files changed

+22
-34
lines changed

.azure/pipelines/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ jobs:
328328
agentOs: Windows
329329
isTestingJob: true
330330
buildScript: ./eng/scripts/cibuild.cmd
331-
buildArgs: -test -BuildNative "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true /p:RunTemplateTests=false /p:BuildSiteExtensions=false"
331+
buildArgs: -test -BuildNative "/p:SkipIISNewHandlerTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false /p:BuildSiteExtensions=false"
332332
beforeBuild:
333333
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
334334
displayName: Setup IISExpress test certificates and schema

src/Servers/IIS/IIS/test/Common.FunctionalTests/Utilities/Helpers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static class Helpers
2525

2626
public static string GetInProcessTestSitesName()
2727
{
28-
return DeployerSelector.IsForwardsCompatibilityTest ? "InProcessForwardsCompatWebSite" : "InProcessWebSite";
28+
return DeployerSelector.IsNewShimTest ? "InProcessNewShimWebSite" : "InProcessWebSite";
2929
}
3030

3131
public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld")

src/Servers/IIS/IIS/test/IIS.FunctionalTests/DeployerSelector.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
88
public static class DeployerSelector
99
{
1010
public static ServerType ServerType => ServerType.IIS;
11-
public static bool IsForwardsCompatibilityTest => false;
11+
public static bool IsNewShimTest => false;
1212
public static bool HasNewShim => true;
1313
public static bool HasNewHandler => true;
1414
}

src/Servers/IIS/IIS/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj

-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
<ItemGroup>
1414
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
15-
<ProjectReference Include="$(RepoRoot)src\Servers\IIS\IntegrationTesting.IIS\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj" />
16-
<ProjectReference Include="$(RepoRoot)src\Hosting\Server.IntegrationTesting\src\Microsoft.AspNetCore.Server.IntegrationTesting.csproj" />
1715

1816
<ProjectReference Include="..\testassets\InProcessWebSite\InProcessWebSite.csproj">
1917
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>

src/Servers/IIS/IIS/test/IIS.BackwardsCompatibility.FunctionalTests/DeployerSelector.cs src/Servers/IIS/IIS/test/IIS.NewHandler.FunctionalTests/DeployerSelector.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
88
public static class DeployerSelector
99
{
1010
public static ServerType ServerType => ServerType.IIS;
11-
public static bool IsForwardsCompatibilityTest => false;
11+
public static bool IsNewShimTest => false;
1212
public static bool HasNewShim => false;
1313
public static bool HasNewHandler => true;
1414
}
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
5-
<TestGroupName>IISBackwardsCompatibility.FunctionalTests</TestGroupName>
5+
<TestGroupName>IISNewHandler.FunctionalTests</TestGroupName>
66
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
7-
<SkipTests Condition=" '$(SkipIISBackwardsCompatibilityTests)' == 'true' ">true</SkipTests>
7+
<SkipTests Condition=" '$(SkipIISNewHandlerTests)' == 'true' ">true</SkipTests>
88
</PropertyGroup>
99

1010
<Import Project="../FunctionalTest.props" />
@@ -16,9 +16,6 @@
1616

1717
<ItemGroup>
1818
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
19-
<ProjectReference Include="..\testassets\**\*.csproj">
20-
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
21-
</ProjectReference>
2219
<ProjectReference Include="..\testassets\InProcessWebSite\InProcessWebSite.csproj">
2320
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
2421
</ProjectReference>
@@ -39,11 +36,4 @@
3936
<Reference Include="System.Net.WebSockets.WebSocketProtocol" />
4037
</ItemGroup>
4138

42-
<Target Name="RemoveSourceOverride" BeforeTargets="_CopyOutOfDateSourceItemsToOutputDirectory">
43-
<ItemGroup>
44-
<SourceItemsToRemove Include="@(_SourceItemsToCopyToOutputDirectory)" Condition="$([System.String]::Copy(%(_SourceItemsToCopyToOutputDirectory.FullPath)).Contains('IIS\AspNetCoreModule')) == 'true'" />
45-
<_SourceItemsToCopyToOutputDirectory Remove="@(SourceItemsToRemove)" />
46-
</ItemGroup>
47-
</Target>
48-
4939
</Project>
+4-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
1111
{
1212
[Collection(IISTestSiteCollection.Name)]
13-
public class BackwardsCompatibilityTests : FixtureLoggedTest
13+
public class NewHandlerTests : FixtureLoggedTest
1414
{
1515
private readonly IISTestSiteFixture _fixture;
1616

17-
public BackwardsCompatibilityTests(IISTestSiteFixture fixture) : base(fixture)
17+
public NewHandlerTests(IISTestSiteFixture fixture) : base(fixture)
1818
{
1919
_fixture = fixture;
2020
}
2121

2222
[ConditionalFact]
23-
public async Task CheckBackwardsCompatibilityIsUsed()
23+
public async Task CheckNewHandlerIsUsed()
2424
{
2525
var response = await _fixture.Client.GetAsync("/HelloWorld");
2626

@@ -31,7 +31,7 @@ public async Task CheckBackwardsCompatibilityIsUsed()
3131

3232
foreach (ProcessModule handle in handles)
3333
{
34-
if (handle.ModuleName == "aspnetcorev2.dll")
34+
if (handle.ModuleName == "aspnetcorev2.dll" || handle.ModuleName == "aspnetcorev2_outofprocess.dll")
3535
{
3636
Assert.Equal("12.2.18316.0", handle.FileVersionInfo.FileVersion);
3737
return;

src/Servers/IIS/IIS/test/IIS.ForwardsCompatibility.FunctionalTests/DeployerSelector.cs src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/DeployerSelector.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
88
public static class DeployerSelector
99
{
1010
public static ServerType ServerType => ServerType.IIS;
11-
public static bool IsForwardsCompatibilityTest => true;
11+
public static bool IsNewShimTest => true;
1212
public static bool HasNewShim => true;
1313
public static bool HasNewHandler => false;
1414
}

src/Servers/IIS/IIS/test/IIS.ForwardsCompatibility.FunctionalTests/ForwardsCompatibilityTests.cs src/Servers/IIS/IIS/test/IIS.NewShim.FunctionalTests/ForwardsCompatibilityTests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
1111
{
1212
[Collection(IISTestSiteCollection.Name)]
13-
public class ForwardsCompatibilityTests : FixtureLoggedTest
13+
public class NewShimTests : FixtureLoggedTest
1414
{
1515
private readonly IISTestSiteFixture _fixture;
1616

17-
public ForwardsCompatibilityTests(IISTestSiteFixture fixture) : base(fixture)
17+
public NewShimTests(IISTestSiteFixture fixture) : base(fixture)
1818
{
1919
_fixture = fixture;
2020
}
2121

2222
[ConditionalFact]
23-
public async Task CheckForwardsCompatibilityIsUsed()
23+
public async Task CheckNewShimIsUsed()
2424
{
2525
var response = await _fixture.Client.GetAsync("/HelloWorld");
2626
var handles = _fixture.DeploymentResult.HostProcess.Modules;
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
5-
<TestGroupName>IISForwardsCompatibility.FunctionalTests</TestGroupName>
5+
<TestGroupName>IISNewShim.FunctionalTests</TestGroupName>
66
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
7-
<SkipTests Condition=" '$(SkipIISForwardsCompatibilityTests)' == 'true' ">true</SkipTests>
7+
<SkipTests Condition=" '$(SkipIISNewShimTests)' == 'true' ">true</SkipTests>
88
</PropertyGroup>
99

1010
<Import Project="../FunctionalTest.props" />
@@ -13,7 +13,7 @@
1313
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
1414
<ProjectReference Include="$(RepoRoot)src\Hosting\Server.IntegrationTesting\src\Microsoft.AspNetCore.Server.IntegrationTesting.csproj" />
1515

16-
<ProjectReference Include="..\testassets\InProcessForwardsCompatWebSite\InProcessForwardsCompatWebSite.csproj">
16+
<ProjectReference Include="..\testassets\InProcessNewShimWebSite\InProcessNewShimWebSite.csproj">
1717
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
1818
</ProjectReference>
1919
</ItemGroup>

src/Servers/IIS/IIS/test/IISExpress.FunctionalTests/DeployerSelector.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
88
public static class DeployerSelector
99
{
1010
public static ServerType ServerType => ServerType.IISExpress;
11-
public static bool IsForwardsCompatibilityTest => false;
11+
public static bool IsNewShimTest => false;
1212
public static bool HasNewShim => true;
1313
public static bool HasNewHandler => true;
1414
}

src/Servers/IIS/IIS/test/testassets/InProcessForwardsCompatWebSite/InProcessForwardsCompatWebSite.csproj src/Servers/IIS/IIS/test/testassets/InProcessNewShimWebSite/InProcessNewShimWebSite.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PropertyGroup>
66
<TargetFramework>netcoreapp3.0</TargetFramework>
77
<AssemblyName>InProcessWebSite</AssemblyName>
8-
<TestAssetOutputName>InProcessForwardsCompatWebSite</TestAssetOutputName>
8+
<TestAssetOutputName>InProcessNewShimWebSite</TestAssetOutputName>
99
<DefineConstants>FORWARDCOMPAT</DefineConstants>
1010
</PropertyGroup>
1111

src/Servers/IIS/IISIntegration.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.Tests", "IIS\test\IIS.T
6363
EndProject
6464
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Tests", "IIS\test\Common.Tests\Common.Tests.csproj", "{D17B7B35-5361-4A50-B499-E03E5C3CC095}"
6565
EndProject
66-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.BackwardsCompatibility.FunctionalTests", "IIS\test\IIS.BackwardsCompatibility.FunctionalTests\IIS.BackwardsCompatibility.FunctionalTests.csproj", "{582B07BC-73F4-4689-8557-B039298BD82C}"
66+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.NewHandler.FunctionalTests", "IIS\test\IIS.NewHandler.FunctionalTests\IIS.NewHandler.FunctionalTests.csproj", "{582B07BC-73F4-4689-8557-B039298BD82C}"
6767
EndProject
68-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.ForwardsCompatibility.FunctionalTests", "IIS\test\IIS.ForwardsCompatibility.FunctionalTests\IIS.ForwardsCompatibility.FunctionalTests.csproj", "{D1EA5D99-28FD-4197-81DE-17098846B38B}"
68+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.NewShim.FunctionalTests", "IIS\test\IIS.NewShim.FunctionalTests\IIS.NewShim.FunctionalTests.csproj", "{D1EA5D99-28FD-4197-81DE-17098846B38B}"
6969
EndProject
7070
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestTasks", "IIS\test\testassets\TestTasks\TestTasks.csproj", "{2DD1269D-131C-4531-BB0D-7BE0EF8E56D0}"
7171
EndProject

src/Servers/IIS/IntegrationTesting.IIS/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
Condition="!Exists('$(AspNetCoreModuleV2ShimDll)') OR !Exists('$(AspNetCoreModuleV2OutOfProcessHandlerDll)')" />
2828
</Target>
2929

30-
<ItemGroup Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(VCTargetsPath)' != ''">
30+
<ItemGroup Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(VCTargetsPath)' != '' AND '$(TestGroupName)' != 'IISNewHandler.FunctionalTests'">
3131
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="x64"/>
3232
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="x64" />
3333

0 commit comments

Comments
 (0)