diff --git a/.appveyor.yml b/.appveyor.yml index 2bc93c45a8932d4d0c0743c1f6476daacc59e88a..f67ca4c0d5746bc602283c245734837c71889419 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -16,7 +16,7 @@ install: - git submodule update --init --recursive - net start w3svc build_script: - - ps: .\run.ps1 default-build + - ps: .\run.ps1 default-build /p:SkipIISBackwardsCompatibilityTests=true clone_depth: 1 environment: global: diff --git a/.vsts-pipelines/templates/build-steps.yml b/.vsts-pipelines/templates/build-steps.yml index 36219f533b62fa88e7483dbf3a67d26df16032cb..780a42a356e09f137fe20da5018a4eec7e7c9592 100644 --- a/.vsts-pipelines/templates/build-steps.yml +++ b/.vsts-pipelines/templates/build-steps.yml @@ -2,6 +2,7 @@ phases: - template: .vsts-pipelines/templates/phases/default-build.yml@buildtools parameters: agentOs: Windows + buildArgs: /p:SkipIISBackwardsCompatibilityTests=true beforeBuild: - powershell: "& ./tools/UpdateIISExpressCertificate.ps1; & ./tools/update_schema.ps1; & ./tools/SetupTestEnvironment.ps1 Setup" displayName: Prepare repo diff --git a/IISIntegration.NoV1.sln b/IISIntegration.NoV1.sln index cbe801fc3206b59c9b1f79810e2d183f3afd882c..2ee59d14bfa8a04416746d6965160f42d4ce584c 100644 --- a/IISIntegration.NoV1.sln +++ b/IISIntegration.NoV1.sln @@ -36,10 +36,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7E80C58E ProjectSection(SolutionItems) = preProject build\applicationhost.config = build\applicationhost.config build\applicationhost.iis.config = build\applicationhost.iis.config - build\build.msbuild = build\build.msbuild build\Build.Settings = build\Build.Settings build\Config.Definitions.Props = build\Config.Definitions.Props build\dependencies.props = build\dependencies.props + build\functional-test-assets.targets = build\functional-test-assets.targets build\Key.snk = build\Key.snk build\launchSettings.json = build\launchSettings.json build\native.targets = build\native.targets @@ -113,6 +113,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.Tests", "test\IIS.Tests EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Tests", "test\Common.Tests\Common.Tests.csproj", "{D17B7B35-5361-4A50-B499-E03E5C3CC095}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.BackwardsCompatibility.FunctionalTests", "test\IIS.BackwardsCompatibility.FunctionalTests\IIS.BackwardsCompatibility.FunctionalTests.csproj", "{582B07BC-73F4-4689-8557-B039298BD82C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -383,6 +385,18 @@ Global {D17B7B35-5361-4A50-B499-E03E5C3CC095}.Release|x64.Build.0 = Release|Any CPU {D17B7B35-5361-4A50-B499-E03E5C3CC095}.Release|x86.ActiveCfg = Release|Any CPU {D17B7B35-5361-4A50-B499-E03E5C3CC095}.Release|x86.Build.0 = Release|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Debug|x64.ActiveCfg = Debug|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Debug|x64.Build.0 = Debug|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Debug|x86.ActiveCfg = Debug|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Debug|x86.Build.0 = Debug|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Release|Any CPU.Build.0 = Release|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Release|x64.ActiveCfg = Release|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Release|x64.Build.0 = Release|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Release|x86.ActiveCfg = Release|Any CPU + {582B07BC-73F4-4689-8557-B039298BD82C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -413,6 +427,7 @@ Global {34135ED7-313D-4E68-860C-D6B51AA28523} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD} {C0310D84-BC2F-4B2E-870E-D35044DB3E3E} = {EF30B533-D715-421A-92B7-92FEF460AC9C} {D17B7B35-5361-4A50-B499-E03E5C3CC095} = {EF30B533-D715-421A-92B7-92FEF460AC9C} + {582B07BC-73F4-4689-8557-B039298BD82C} = {EF30B533-D715-421A-92B7-92FEF460AC9C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DB4F868D-E1AE-4FD7-9333-69FA15B268C5} diff --git a/IISIntegration.sln b/IISIntegration.sln index 34a5050f7edc9a73a5d70531383eeba1f245250d..6e8b394d5a9fa01015937938553554efbd00860e 100644 --- a/IISIntegration.sln +++ b/IISIntegration.sln @@ -121,6 +121,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.Tests", "test\IIS.Tests EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Common.Tests", "test\Common.Tests\Common.Tests.csproj", "{A641A208-2974-4E48-BCFF-54E3AAFA4FB9}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IIS.BackwardsCompatibility.FunctionalTests", "test\IIS.BackwardsCompatibility.FunctionalTests\IIS.BackwardsCompatibility.FunctionalTests.csproj", "{28055B05-25D4-4F17-9F36-A1D09FDDA607}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -637,6 +639,26 @@ Global {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Release|x64.Build.0 = Release|Any CPU {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Release|x86.ActiveCfg = Release|Any CPU {A641A208-2974-4E48-BCFF-54E3AAFA4FB9}.Release|x86.Build.0 = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Debug|x64.ActiveCfg = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Debug|x64.Build.0 = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Debug|x86.ActiveCfg = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Debug|x86.Build.0 = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.NativeDebug|Any CPU.ActiveCfg = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.NativeDebug|Any CPU.Build.0 = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.NativeDebug|x64.ActiveCfg = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.NativeDebug|x86.ActiveCfg = Debug|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.NativeRelease|Any CPU.ActiveCfg = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.NativeRelease|Any CPU.Build.0 = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.NativeRelease|x64.ActiveCfg = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.NativeRelease|x86.ActiveCfg = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Release|Any CPU.Build.0 = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Release|x64.ActiveCfg = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Release|x64.Build.0 = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Release|x86.ActiveCfg = Release|Any CPU + {28055B05-25D4-4F17-9F36-A1D09FDDA607}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -670,6 +692,7 @@ Global {CE4FB142-91FB-4B34-BC96-A31120EF4009} = {04B1EDB6-E967-4D25-89B9-E6F8304038CD} {A091777D-66B3-42E1-B95C-85322DE40706} = {EF30B533-D715-421A-92B7-92FEF460AC9C} {A641A208-2974-4E48-BCFF-54E3AAFA4FB9} = {EF30B533-D715-421A-92B7-92FEF460AC9C} + {28055B05-25D4-4F17-9F36-A1D09FDDA607} = {EF30B533-D715-421A-92B7-92FEF460AC9C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {DB4F868D-E1AE-4FD7-9333-69FA15B268C5} diff --git a/build/build.msbuild b/build/build.msbuild deleted file mode 100644 index c97f1a53b5ca228d57b8ea4c85031600a30d550f..0000000000000000000000000000000000000000 --- a/build/build.msbuild +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="12.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <Import Project="$(MSBuildThisFileDirectory)\Build.Settings" /> - - <ItemGroup> - <Projects Include="$(SolutionDir)\src\AspNetCoreModuleV1\AspNetCore\AspNetCore.vcxproj" /> - <Projects Include="$(SolutionDir)\src\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" /> - <Projects Include="$(SolutionDir)\src\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" /> - <Projects Include="$(SolutionDir)\src\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" /> - <Projects Include="$(SolutionDir)\test\CommonLibTests\CommonLibTests.vcxproj"> - </ItemGroup> - - <Target Name="Build"> - <MSBuild Targets="$(BuildTargets)" - Projects="@(Projects)" - Properties="Configuration=$(Configuration);Platform=$(Platform);PlatformToolset=$(PlatformToolset)" /> - </Target> - - <Target Name="Clean"> - <MSBuild Targets="Clean" - Projects="@(Projects)" /> - </Target> - - <Target Name="Rebuild"> - <MSBuild Targets="Clean;Build" - Projects="$(MSBuildProjectFile)" - Properties="BuildTargets=Rebuild;Configuration=$(Configuration);Platform=$(Platform);PlatformToolset=$(PlatformToolset)"/> - </Target> - - <Target Name="Test" DependsOnTargets="Build"> - <!-- once we have test project ready, we should add executions to run the test post build--> - </Target> - <Import Project="Config.Definitions.Props" /> - </Project> diff --git a/build/buildpipeline/pipeline.groovy b/build/buildpipeline/pipeline.groovy index 7ccbca0b2ade900af798ce3555c10b6f21fccb87..7d4b4aef159800bd9cf03ba056430fecde35c704 100644 --- a/build/buildpipeline/pipeline.groovy +++ b/build/buildpipeline/pipeline.groovy @@ -1,6 +1,7 @@ import org.dotnet.ci.pipelines.Pipeline def windowsPipeline = Pipeline.createPipeline(this, 'build/buildpipeline/windows.groovy') +def windowBackwardsCompatibilityPipeline = Pipeline.createPipeline(this, 'build/buildpipeline/windows-BackwardsCompatibility.groovy') def configurations = [ 'Debug', @@ -15,4 +16,5 @@ configurations.each { configuration -> windowsPipeline.triggerPipelineOnEveryGithubPR("Windows ${configuration} x64 Build", params) windowsPipeline.triggerPipelineOnGithubPush(params) + windowBackwardsCompatibilityPipeline.triggerPipelineOnEveryGithubPR("Windows ${configuration} x64 Build", params) } diff --git a/build/buildpipeline/windows-staticshim.groovy b/build/buildpipeline/windows-staticshim.groovy new file mode 100644 index 0000000000000000000000000000000000000000..b6b81e2f0b7e3f06423c7e1124cb1554a249bb82 --- /dev/null +++ b/build/buildpipeline/windows-staticshim.groovy @@ -0,0 +1,15 @@ +@Library('dotnet-ci') _ + +// 'node' indicates to Jenkins that the enclosed block runs on a node that matches +// the label 'windows-with-vs' +simpleNode('Windows.10.Amd64.EnterpriseRS3.ASPNET.Open') { + stage ('Checking out source') { + checkout scm + bat 'git submodule update --init --recursive' + } + stage ('Build') { + def logFolder = getLogFolder() + def environment = "\$env:ASPNETCORE_TEST_LOG_DIR='${WORKSPACE}\\${logFolder}'" + bat "powershell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command \"${environment};&.\\tools\\SetupTestEnvironment.ps1 SetupDumps;&.\\tools\\update_schema.ps1;&.\\tools\\UpdateIISExpressCertificate.ps1;&.\\run.cmd -CI default-build /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:Configuration=${params.Configuration}\";" + } +} diff --git a/build/buildpipeline/windows.groovy b/build/buildpipeline/windows.groovy index 35bb4737ae1611397d57955ac8bb6afd4f057602..cc42e9ab4fe54be6ac7074024dba8ca5fd978b65 100644 --- a/build/buildpipeline/windows.groovy +++ b/build/buildpipeline/windows.groovy @@ -10,6 +10,6 @@ simpleNode('Windows.10.Amd64.EnterpriseRS3.ASPNET.Open') { stage ('Build') { def logFolder = getLogFolder() def environment = "\$env:ASPNETCORE_TEST_LOG_DIR='${WORKSPACE}\\${logFolder}'" - bat "powershell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command \"${environment};&.\\tools\\SetupTestEnvironment.ps1 SetupDumps;&.\\tools\\update_schema.ps1;&.\\tools\\UpdateIISExpressCertificate.ps1;&.\\run.cmd -CI default-build /p:Configuration=${params.Configuration}\";" + bat "powershell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command \"${environment};&.\\tools\\SetupTestEnvironment.ps1 SetupDumps;&.\\tools\\update_schema.ps1;&.\\tools\\UpdateIISExpressCertificate.ps1;&.\\run.cmd -CI default-build /p:SkipIISBackwardsCompatibilityTests=true /p:Configuration=${params.Configuration}\";" } } diff --git a/build/dependencies.props b/build/dependencies.props index 5c5ee5437f74e045a8039a71248a007afd5710e2..5f13736d1286c5d264d5bf2d1b5c8fd21df357be 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -54,5 +54,8 @@ <XunitRunnerVisualStudioPackageVersion>2.4.0</XunitRunnerVisualStudioPackageVersion> </PropertyGroup> <Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " /> - <PropertyGroup Label="Package Versions: Pinned" /> + <PropertyGroup Label="Package Versions: Pinned" > + <MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.2.0-preview3-35458</MicrosoftAspNetCoreAspNetCoreModulePackageVersion> + <MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion>2.2.0-preview3-35458</MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion> + </PropertyGroup> </Project> diff --git a/build/functional-test-assets.targets b/build/functional-test-assets.targets new file mode 100644 index 0000000000000000000000000000000000000000..81fb82b4a3d0b80b7c13fa8071a7ee4156e3a8f7 --- /dev/null +++ b/build/functional-test-assets.targets @@ -0,0 +1,10 @@ +<Project> + <Import Project="assets.props"/> + <Target Name="AddRunNativeComponents" BeforeTargets="AssignTargetPaths" Condition="$(PackNativeAssets) == 'true'"> + <ItemGroup> + <None Include="%(RunShimComponents.DllLocation)" CopyToOutputDirectory="PreserveNewest" Link="%(RunShimComponents.Platform)\%(RunShimComponents.PackageSubPath)%(RunShimComponents.NativeAsset).dll" /> + + <None Include="%(RunShimComponents.PdbLocation)" CopyToOutputDirectory="PreserveNewest" Link="%(RunShimComponents.Platform)\%(RunShimComponents.PackageSubPath)%(RunShimComponents.NativeAsset).pdb" /> + </ItemGroup> + </Target> +</Project> diff --git a/build/repo.props b/build/repo.props index 77073056a2bcb8ba46c0cec2a71dbfa65f29bedd..fd4d80cb7ac66ac171bcebbbad3701d8fb3698e0 100644 --- a/build/repo.props +++ b/build/repo.props @@ -13,6 +13,18 @@ <ExcludeSolutions Include="$(RepositoryRoot)IISIntegration.NoV1.sln" /> </ItemGroup> + <ItemGroup Condition="'$(SkipIISTests)' == 'true'" > + <ExcludeFromTest Include="$(RepositoryRoot)test\IIS.FunctionalTests\*.csproj" /> + </ItemGroup> + + <ItemGroup Condition="'$(SkipIISExpressTests)' == 'true'" > + <ExcludeFromTest Include="$(RepositoryRoot)test\IISExpress.FunctionalTests\*.csproj" /> + </ItemGroup> + + <ItemGroup Condition="'$(SkipIISBackwardsCompatibilityTests)' == 'true'" > + <ExcludeFromTest Include="$(RepositoryRoot)test\IIS.BackwardsCompatibility.FunctionalTests\*.csproj" /> + </ItemGroup> + <PropertyGroup> <!-- These properties are use by the automation that updates dependencies.props --> <LineupPackageId>Internal.AspNetCore.Universe.Lineup</LineupPackageId> diff --git a/build/testsite.props b/build/testsite.props index 1ef6bf81cc9ee24eeffa2be3658d534e3bfc93fe..74f205b4cf7d6d6805f57fce60adccef6578cbec 100644 --- a/build/testsite.props +++ b/build/testsite.props @@ -23,7 +23,6 @@ <NativeFolder>x64</NativeFolder> </PropertyGroup> - <PropertyGroup> <!-- For standalone publish, all dlls are flattened to the same folder. Set the base path to the request handler diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj index f0332ef10ba0959c238cee6a2d2f95b14f13c1f0..bdfe8abfa9ce84995066b9905ecd134c58741154 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj +++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj @@ -1,4 +1,4 @@ -<Project Sdk="Microsoft.NET.Sdk"> +<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> @@ -24,39 +24,24 @@ </ItemGroup> <ItemGroup Condition="'$(VCTargetsPath)' != ''"> - <ProjectReference Include="..\AspNetCoreModuleV1\AspNetCore\AspNetCore.vcxproj" > + <ProjectReference Include="..\AspNetCoreModuleV1\AspNetCore\AspNetCore.vcxproj"> <ReferenceOutputAssembly>False</ReferenceOutputAssembly> </ProjectReference> - <ProjectReference Include="..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" > + <ProjectReference Include="..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj"> <ReferenceOutputAssembly>False</ReferenceOutputAssembly> </ProjectReference> - <ProjectReference Include="..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj " > + <ProjectReference Include="..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj "> <ReferenceOutputAssembly>False</ReferenceOutputAssembly> </ProjectReference> </ItemGroup> <Target Name="AddPackNativeComponents" BeforeTargets="_GetPackageFiles;GetSignedPackageFiles" Condition="$(PackNativeAssets) == 'true'"> <ItemGroup> - <Content Include="%(ShimComponents.DllLocation)" - PackageCopyToOutput="true" - PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)"/> + <Content Include="%(ShimComponents.DllLocation)" PackageCopyToOutput="true" PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)" /> - <SignedPackageFile Include="%(ShimComponents.DllLocation)" - PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)%(ShimComponents.NativeAsset).dll" - Certificate="$(AssemblySigningCertName)" /> + <SignedPackageFile Include="%(ShimComponents.DllLocation)" PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)%(ShimComponents.NativeAsset).dll" Certificate="$(AssemblySigningCertName)" /> </ItemGroup> </Target> - - <Target Name="AddRunNativeComponents" BeforeTargets="AssignTargetPaths" Condition="$(PackNativeAssets) == 'true'"> - <ItemGroup> - <None Include="%(RunShimComponents.DllLocation)" - CopyToOutputDirectory="PreserveNewest" - Link="%(RunShimComponents.Platform)\%(RunShimComponents.PackageSubPath)%(RunShimComponents.NativeAsset).dll" /> - - <None Include="%(RunShimComponents.PdbLocation)" - CopyToOutputDirectory="PreserveNewest" - Link="%(RunShimComponents.Platform)\%(RunShimComponents.PackageSubPath)%(RunShimComponents.NativeAsset).pdb" /> - </ItemGroup> - </Target> + </Project> diff --git a/test/IIS.FunctionalTests/Inprocess/StartupTests.cs b/test/Common.FunctionalTests/Inprocess/StartupTests.cs similarity index 100% rename from test/IIS.FunctionalTests/Inprocess/StartupTests.cs rename to test/Common.FunctionalTests/Inprocess/StartupTests.cs diff --git a/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs b/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs index cb76b503c5eeacd32e3baeeb4e1fdd018148bf28..f9e6836b6fcc9dafb1b4e643c1802bd384da102e 100644 --- a/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs +++ b/test/Common.FunctionalTests/OutOfProcess/GlobalVersionTests.cs @@ -45,6 +45,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests [ConditionalFact] [RequiresIIS(IISCapability.PoolEnvironmentVariables)] + [RequiresNewShim] public async Task GlobalVersion_EnvironmentVariableWorks() { var temporaryFile = Path.GetTempFileName(); diff --git a/test/IIS.BackwardsCompatibility.FunctionalTests/BackwardsCompatibilityTests.cs b/test/IIS.BackwardsCompatibility.FunctionalTests/BackwardsCompatibilityTests.cs new file mode 100644 index 0000000000000000000000000000000000000000..a7243b02727da771f1f01a0229a83d03de1380fb --- /dev/null +++ b/test/IIS.BackwardsCompatibility.FunctionalTests/BackwardsCompatibilityTests.cs @@ -0,0 +1,49 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Diagnostics; +using System.IO; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities; +using Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.AspNetCore.Testing.xunit; +using Xunit; +using Xunit.Sdk; + +namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests +{ + [Collection(PublishedSitesCollection.Name)] + public class BackwardsCompatibilityTests : IISFunctionalTestBase + { + private readonly PublishedSitesFixture _fixture; + + public BackwardsCompatibilityTests(PublishedSitesFixture fixture) + { + _fixture = fixture; + } + + [ConditionalFact] + public async Task CheckBackwardsCompatibilityIsUsed() + { + var iisDeploymentParameters = _fixture.GetBaseDeploymentParameters(publish: true); + iisDeploymentParameters.PreservePublishedApplicationForDebugging = true; + var deploymentResult = await DeployAsync(iisDeploymentParameters); + + var arch = iisDeploymentParameters.RuntimeArchitecture == RuntimeArchitecture.x64 ? $@"x64\aspnetcorev2.dll" : $@"x86\aspnetcorev2.dll"; + + var fileInfo = FileVersionInfo.GetVersionInfo(Path.Combine(AppContext.BaseDirectory, arch)); + var response = await deploymentResult.HttpClient.GetAsync("/HelloWorld"); + var handles = deploymentResult.HostProcess.Modules; + foreach (ProcessModule handle in handles) + { + if (handle.ModuleName == "aspnetcorev2.dll") + { + Assert.Equal("12.2.18283.0", handle.FileVersionInfo.FileVersion); + return; + } + } + throw new XunitException($"Could not find aspnetcorev2.dll loaded in process {deploymentResult.HostProcess.ProcessName}"); + } + } +} diff --git a/test/IIS.BackwardsCompatibility.FunctionalTests/IIS.BackwardsCompatibility.FunctionalTests.csproj b/test/IIS.BackwardsCompatibility.FunctionalTests/IIS.BackwardsCompatibility.FunctionalTests.csproj new file mode 100644 index 0000000000000000000000000000000000000000..58708fa85f64f09e109b0c09a3d3d9fb18027ce6 --- /dev/null +++ b/test/IIS.BackwardsCompatibility.FunctionalTests/IIS.BackwardsCompatibility.FunctionalTests.csproj @@ -0,0 +1,56 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFrameworks>netcoreapp2.2</TargetFrameworks> + <TestGroupName>IISBackwardsCompatibility.FunctionalTests</TestGroupName> + <DisableFastUpToDateCheck>True</DisableFastUpToDateCheck> + </PropertyGroup> + + <ItemGroup> + <Content Include="..\Common.FunctionalTests\AppHostConfig\*.config" CopyToOutputDirectory="PreserveNewest" /> + </ItemGroup> + + <ItemGroup> + <ProjectReference Include="..\..\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj" /> + <ProjectReference Include="..\Common.Tests\Common.Tests.csproj" /> + <ProjectReference Include="..\WebSites\InProcessWebSite\InProcessWebSite.csproj"> + <ReferenceOutputAssembly>False</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\WebSites\OutOfProcessWebSite\OutOfProcessWebSite.csproj"> + <ReferenceOutputAssembly>False</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\WebSites\StressTestWebSite\StressTestWebSite.csproj"> + <ReferenceOutputAssembly>False</ReferenceOutputAssembly> + </ProjectReference> + </ItemGroup> + + <ItemGroup> + <Compile Include="..\Common.FunctionalTests\**\*.cs" /> + <Compile Include="..\IIS.Shared.FunctionalTests\**\*.cs" /> + </ItemGroup> + + <ItemGroup> + <PackageReference Include="Microsoft.AspNetCore.AspNetCoreModule" Version="$(MicrosoftAspNetCoreAspNetCoreModulePackageVersion)" /> + <PackageReference Include="Microsoft.AspNetCore.AspNetCoreModuleV2" Version="$(MicrosoftAspNetCoreAspNetCoreModuleV2PackageVersion)" /> + <PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="$(MicrosoftAspNetCoreServerIntegrationTestingPackageVersion)" /> + <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" /> + <PackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingPackageVersion)" /> + <PackageReference Include="Microsoft.Extensions.Logging.Testing" Version="$(MicrosoftExtensionsLoggingTestingPackageVersion)" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" /> + <PackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" /> + <PackageReference Include="System.Net.WebSockets.WebSocketProtocol" Version="$(SystemNetWebSocketsWebSocketProtocolPackageVersion)" /> + <PackageReference Include="xunit" Version="$(XunitPackageVersion)" /> + <PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioPackageVersion)" /> + </ItemGroup> + + <ItemGroup> + <None Remove="AppHostConfig\HostableWebCore.config" /> + </ItemGroup> + + <ItemGroup> + <Content Update="AppHostConfig\HostableWebCore.config"> + <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> + </Content> + </ItemGroup> + +</Project> diff --git a/test/IIS.BackwardsCompatibility.FunctionalTests/RequiresNewShim.cs b/test/IIS.BackwardsCompatibility.FunctionalTests/RequiresNewShim.cs new file mode 100644 index 0000000000000000000000000000000000000000..f14085b05bf5f6d2f8e276abcf15e71f581e89c3 --- /dev/null +++ b/test/IIS.BackwardsCompatibility.FunctionalTests/RequiresNewShim.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.AspNetCore.Testing.xunit; + +namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests +{ + [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] + public sealed class RequiresNewShimAttribute : Attribute, ITestCondition + { + public bool IsMet => false; + + public string SkipReason => "Test verifies new behavior in the aspnetcorev2.dll that isn't supported in earlier versions."; + } +} diff --git a/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj b/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj index 0114f027ca21b225d0b102b30e9fce272699a2d9..47c316f65a968990265e4b3170e7899a2fbcab9a 100644 --- a/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj +++ b/test/IIS.FunctionalTests/IIS.FunctionalTests.csproj @@ -26,8 +26,11 @@ <ItemGroup> <Compile Include="..\Common.FunctionalTests\**\*.cs" /> + <Compile Include="..\IIS.Shared.FunctionalTests\**\*.cs" /> </ItemGroup> + <Import Project="..\..\build\functional-test-assets.targets" /> + <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="$(MicrosoftAspNetCoreServerIntegrationTestingPackageVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" /> diff --git a/test/IIS.FunctionalTests/RequiresNewShim.cs b/test/IIS.FunctionalTests/RequiresNewShim.cs new file mode 100644 index 0000000000000000000000000000000000000000..1765ba2d1ee1292a99d522d892cfefb46dbf8399 --- /dev/null +++ b/test/IIS.FunctionalTests/RequiresNewShim.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.AspNetCore.Testing.xunit; + +namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests +{ + [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] + public sealed class RequiresNewShimAttribute : Attribute, ITestCondition + { + public bool IsMet => true; + + public string SkipReason => "IIS.FunctionalTests always run against new shim."; + } +} diff --git a/test/IIS.FunctionalTests/DeployerSelector.cs b/test/IIS.Shared.FunctionalTests/DeployerSelector.cs similarity index 100% rename from test/IIS.FunctionalTests/DeployerSelector.cs rename to test/IIS.Shared.FunctionalTests/DeployerSelector.cs diff --git a/test/IIS.FunctionalTests/Inprocess/StdOutRedirectionTests.cs b/test/IIS.Shared.FunctionalTests/Inprocess/StdOutRedirectionTests.cs similarity index 100% rename from test/IIS.FunctionalTests/Inprocess/StdOutRedirectionTests.cs rename to test/IIS.Shared.FunctionalTests/Inprocess/StdOutRedirectionTests.cs diff --git a/test/IIS.FunctionalTests/MofFileTests.cs b/test/IIS.Shared.FunctionalTests/MofFileTests.cs similarity index 100% rename from test/IIS.FunctionalTests/MofFileTests.cs rename to test/IIS.Shared.FunctionalTests/MofFileTests.cs diff --git a/test/IIS.FunctionalTests/Properties/AssemblyInfo.cs b/test/IIS.Shared.FunctionalTests/Properties/AssemblyInfo.cs similarity index 100% rename from test/IIS.FunctionalTests/Properties/AssemblyInfo.cs rename to test/IIS.Shared.FunctionalTests/Properties/AssemblyInfo.cs diff --git a/test/IIS.FunctionalTests/RequiresIISAttribute.cs b/test/IIS.Shared.FunctionalTests/RequiresIISAttribute.cs similarity index 99% rename from test/IIS.FunctionalTests/RequiresIISAttribute.cs rename to test/IIS.Shared.FunctionalTests/RequiresIISAttribute.cs index 6c47c4d0906f248c00c9cdd0bc8a0b09e5b9fabe..cfbbf7048676a886f47145fa1304fe0c84d6933d 100644 --- a/test/IIS.FunctionalTests/RequiresIISAttribute.cs +++ b/test/IIS.Shared.FunctionalTests/RequiresIISAttribute.cs @@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests } public RequiresIISAttribute() - : this (IISCapability.None) { } + : this(IISCapability.None) { } public RequiresIISAttribute(IISCapability capabilities) { diff --git a/test/IIS.FunctionalTests/ServicesTests.cs b/test/IIS.Shared.FunctionalTests/ServicesTests.cs similarity index 100% rename from test/IIS.FunctionalTests/ServicesTests.cs rename to test/IIS.Shared.FunctionalTests/ServicesTests.cs diff --git a/test/IIS.Tests/IIS.Tests.csproj b/test/IIS.Tests/IIS.Tests.csproj index 614a28662615bde8405bbff900f39945bcc905d8..3fdb2a53635127e9146a9453ee68a771ad25c60c 100644 --- a/test/IIS.Tests/IIS.Tests.csproj +++ b/test/IIS.Tests/IIS.Tests.csproj @@ -1,16 +1,17 @@ -<Project Sdk="Microsoft.NET.Sdk"> +<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>netcoreapp2.2</TargetFrameworks> </PropertyGroup> - <Import Project="..\..\build\assets.props" /> + <Import Project="..\..\build\functional-test-assets.targets" /> <ItemGroup> <ProjectReference Include="..\..\src\Microsoft.AspNetCore.Server.IIS\Microsoft.AspNetCore.Server.IIS.csproj" /> <ProjectReference Include="..\Common.Tests\Common.Tests.csproj" /> </ItemGroup> + <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="$(MicrosoftAspNetCoreServerIntegrationTestingPackageVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" /> diff --git a/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj b/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj index e62095f98fdf273c7f16027c408d32814a80e004..ff8fd55afbf997eb952a89f0023850db26b9c8fa 100644 --- a/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj +++ b/test/IISExpress.FunctionalTests/IISExpress.FunctionalTests.csproj @@ -21,6 +21,8 @@ <Compile Include="..\Common.FunctionalTests\**\*.cs" /> </ItemGroup> + <Import Project="..\..\build\functional-test-assets.targets" /> + <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="$(MicrosoftAspNetCoreServerIntegrationTestingPackageVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" /> diff --git a/test/IISExpress.FunctionalTests/RequiresNewShim.cs b/test/IISExpress.FunctionalTests/RequiresNewShim.cs new file mode 100644 index 0000000000000000000000000000000000000000..a43e9b8da7c1bec0ded6dab212fcef480131d125 --- /dev/null +++ b/test/IISExpress.FunctionalTests/RequiresNewShim.cs @@ -0,0 +1,17 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNetCore.Server.IntegrationTesting; +using Microsoft.AspNetCore.Testing.xunit; + +namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests +{ + [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] + public sealed class RequiresNewShimAttribute : Attribute, ITestCondition + { + public bool IsMet => true; + + public string SkipReason => "IISExpress.FunctionalTests always run against new shim."; + } +}