Guarantee that ANCM package dlls are used for back compat tests (#10858)

This commit is contained in:
Justin Kotalik 2019-06-05 20:11:47 -07:00 committed by GitHub
parent f080c89e89
commit d3e90a7c07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 22 additions and 34 deletions

View File

@ -328,7 +328,7 @@ jobs:
agentOs: Windows
isTestingJob: true
buildScript: ./eng/scripts/cibuild.cmd
buildArgs: -test -BuildNative "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true /p:RunTemplateTests=false /p:BuildSiteExtensions=false"
buildArgs: -test -BuildNative "/p:SkipIISNewHandlerTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false /p:BuildSiteExtensions=false"
beforeBuild:
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
displayName: Setup IISExpress test certificates and schema

View File

@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
public static string GetInProcessTestSitesName()
{
return DeployerSelector.IsForwardsCompatibilityTest ? "InProcessForwardsCompatWebSite" : "InProcessWebSite";
return DeployerSelector.IsNewShimTest ? "InProcessNewShimWebSite" : "InProcessWebSite";
}
public static async Task AssertStarts(this IISDeploymentResult deploymentResult, string path = "/HelloWorld")

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
public static class DeployerSelector
{
public static ServerType ServerType => ServerType.IIS;
public static bool IsForwardsCompatibilityTest => false;
public static bool IsNewShimTest => false;
public static bool HasNewShim => true;
public static bool HasNewHandler => true;
}

View File

@ -12,8 +12,6 @@
<ItemGroup>
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
<ProjectReference Include="$(RepoRoot)src\Servers\IIS\IntegrationTesting.IIS\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj" />
<ProjectReference Include="$(RepoRoot)src\Hosting\Server.IntegrationTesting\src\Microsoft.AspNetCore.Server.IntegrationTesting.csproj" />
<ProjectReference Include="..\testassets\InProcessWebSite\InProcessWebSite.csproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
public static class DeployerSelector
{
public static ServerType ServerType => ServerType.IIS;
public static bool IsForwardsCompatibilityTest => false;
public static bool IsNewShimTest => false;
public static bool HasNewShim => false;
public static bool HasNewHandler => true;
}

View File

@ -2,9 +2,9 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>IISBackwardsCompatibility.FunctionalTests</TestGroupName>
<TestGroupName>IISNewHandler.FunctionalTests</TestGroupName>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
<SkipTests Condition=" '$(SkipIISBackwardsCompatibilityTests)' == 'true' ">true</SkipTests>
<SkipTests Condition=" '$(SkipIISNewHandlerTests)' == 'true' ">true</SkipTests>
</PropertyGroup>
<Import Project="../FunctionalTest.props" />
@ -16,9 +16,6 @@
<ItemGroup>
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
<ProjectReference Include="..\testassets\**\*.csproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\testassets\InProcessWebSite\InProcessWebSite.csproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
@ -39,11 +36,4 @@
<Reference Include="System.Net.WebSockets.WebSocketProtocol" />
</ItemGroup>
<Target Name="RemoveSourceOverride" BeforeTargets="_CopyOutOfDateSourceItemsToOutputDirectory">
<ItemGroup>
<SourceItemsToRemove Include="@(_SourceItemsToCopyToOutputDirectory)" Condition="$([System.String]::Copy(%(_SourceItemsToCopyToOutputDirectory.FullPath)).Contains('IIS\AspNetCoreModule')) == 'true'" />
<_SourceItemsToCopyToOutputDirectory Remove="@(SourceItemsToRemove)" />
</ItemGroup>
</Target>
</Project>

View File

@ -10,17 +10,17 @@ using Xunit.Sdk;
namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
{
[Collection(IISTestSiteCollection.Name)]
public class BackwardsCompatibilityTests : FixtureLoggedTest
public class NewHandlerTests : FixtureLoggedTest
{
private readonly IISTestSiteFixture _fixture;
public BackwardsCompatibilityTests(IISTestSiteFixture fixture) : base(fixture)
public NewHandlerTests(IISTestSiteFixture fixture) : base(fixture)
{
_fixture = fixture;
}
[ConditionalFact]
public async Task CheckBackwardsCompatibilityIsUsed()
public async Task CheckNewHandlerIsUsed()
{
var response = await _fixture.Client.GetAsync("/HelloWorld");
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
foreach (ProcessModule handle in handles)
{
if (handle.ModuleName == "aspnetcorev2.dll")
if (handle.ModuleName == "aspnetcorev2.dll" || handle.ModuleName == "aspnetcorev2_outofprocess.dll")
{
Assert.Equal("12.2.18316.0", handle.FileVersionInfo.FileVersion);
return;

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
public static class DeployerSelector
{
public static ServerType ServerType => ServerType.IIS;
public static bool IsForwardsCompatibilityTest => true;
public static bool IsNewShimTest => true;
public static bool HasNewShim => true;
public static bool HasNewHandler => false;
}

View File

@ -10,17 +10,17 @@ using Xunit.Sdk;
namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
{
[Collection(IISTestSiteCollection.Name)]
public class ForwardsCompatibilityTests : FixtureLoggedTest
public class NewShimTests : FixtureLoggedTest
{
private readonly IISTestSiteFixture _fixture;
public ForwardsCompatibilityTests(IISTestSiteFixture fixture) : base(fixture)
public NewShimTests(IISTestSiteFixture fixture) : base(fixture)
{
_fixture = fixture;
}
[ConditionalFact]
public async Task CheckForwardsCompatibilityIsUsed()
public async Task CheckNewShimIsUsed()
{
var response = await _fixture.Client.GetAsync("/HelloWorld");
var handles = _fixture.DeploymentResult.HostProcess.Modules;

View File

@ -2,9 +2,9 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>IISForwardsCompatibility.FunctionalTests</TestGroupName>
<TestGroupName>IISNewShim.FunctionalTests</TestGroupName>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
<SkipTests Condition=" '$(SkipIISForwardsCompatibilityTests)' == 'true' ">true</SkipTests>
<SkipTests Condition=" '$(SkipIISNewShimTests)' == 'true' ">true</SkipTests>
</PropertyGroup>
<Import Project="../FunctionalTest.props" />
@ -13,7 +13,7 @@
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
<ProjectReference Include="$(RepoRoot)src\Hosting\Server.IntegrationTesting\src\Microsoft.AspNetCore.Server.IntegrationTesting.csproj" />
<ProjectReference Include="..\testassets\InProcessForwardsCompatWebSite\InProcessForwardsCompatWebSite.csproj">
<ProjectReference Include="..\testassets\InProcessNewShimWebSite\InProcessNewShimWebSite.csproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
public static class DeployerSelector
{
public static ServerType ServerType => ServerType.IISExpress;
public static bool IsForwardsCompatibilityTest => false;
public static bool IsNewShimTest => false;
public static bool HasNewShim => true;
public static bool HasNewHandler => true;
}

View File

@ -5,7 +5,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AssemblyName>InProcessWebSite</AssemblyName>
<TestAssetOutputName>InProcessForwardsCompatWebSite</TestAssetOutputName>
<TestAssetOutputName>InProcessNewShimWebSite</TestAssetOutputName>
<DefineConstants>FORWARDCOMPAT</DefineConstants>
</PropertyGroup>

View File

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

View File

@ -27,7 +27,7 @@
Condition="!Exists('$(AspNetCoreModuleV2ShimDll)') OR !Exists('$(AspNetCoreModuleV2OutOfProcessHandlerDll)')" />
</Target>
<ItemGroup Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(VCTargetsPath)' != ''">
<ItemGroup Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(VCTargetsPath)' != '' AND '$(TestGroupName)' != 'IISNewHandler.FunctionalTests'">
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="x64"/>
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="x64" />