Skip to content

Commit

Permalink
Execute interop and template tests on latest Fx (#32510)
Browse files Browse the repository at this point in the history
- restore `$(TestDependsOnAspNetRuntime)` settings
  - needed to execute on just-built Microsoft.AspNetCore.App.Runtime
- separate from `$(TestDependsOnAspNetPackages)` because App.UnitTests need only the packages
- import Helix.props when Helix.targets is imported
  - ensure necessary `$(IsTestProject)` overrides occur prior to explicit root Directory.Build.props imports

nit: use `bool` form in `Conditions` using above properties
  • Loading branch information
dougbu authored May 9, 2021
1 parent a38fc6a commit 07c6a62
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions eng/targets/Helix.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<LoggingTestingDisableFileLogging Condition="'$(IsHelixJob)' == 'true'">false</LoggingTestingDisableFileLogging>
<NodeVersion>10.15.3</NodeVersion>
<TestDependsOnAspNetPackages>false</TestDependsOnAspNetPackages>
<TestDependsOnAspNetRuntime>false</TestDependsOnAspNetRuntime>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
Expand Down
9 changes: 7 additions & 2 deletions eng/targets/Helix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup Condition="'$(TestDependsOnPlaywright)' == 'true' AND '$(IsWindowsHelixQueue)' == 'true'">
<HelixPreCommand Include="call RunPowershell.cmd installPlaywrightReqs.ps1 || exit /b 1" />
</ItemGroup>

<ItemGroup Condition="'$(TestDependsOnIIS)' == 'true' AND '$(IsWindowsOnlyTest)' == 'true'">
<HelixContent Include="$(RepoRoot)src\Servers\IIS\tools\update_schema.ps1" />
<HelixContent Include="$(RepoRoot)src\Servers\IIS\tools\UpdateIISExpressCertificate.ps1" />
Expand All @@ -35,10 +35,15 @@
<HelixPreCommand Include="call RunPowershell.cmd InstallNode.ps1 $(NodeVersion) || exit /b 1" />
</ItemGroup>

<ItemGroup Condition=" '$(TestDependsOnAspNetPackages)' == 'true' ">
<!-- $(TestDependsOnAspNetRuntime) implies $(TestDependsOnAspNetPackages). Separate for the App.UnitTests case. -->
<PropertyGroup Condition=" $(TestDependsOnAspNetRuntime) AND !$(TestDependsOnAspNetPackages) ">
<TestDependsOnAspNetPackages>true</TestDependsOnAspNetPackages>
</PropertyGroup>
<ItemGroup Condition=" $(TestDependsOnAspNetPackages) ">
<!-- Grab all shipping packages. -->
<HelixContent Include="$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\*$(SharedFxVersion).nupkg" />
</ItemGroup>

<ItemGroup>
<!-- Java test projects do not use xUnit. -->
<HelixContent Include="$(OutputPath)Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestAdapter.dll"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<Project DefaultTargets="Build">
<PropertyGroup>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Grpc/test/InteropTests/InteropTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<ContainsFunctionalTestAssets>true</ContainsFunctionalTestAssets>
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
<TestDependsOnAspNetPackages>true</TestDependsOnAspNetPackages>
<TestDependsOnAspNetRuntime>true</TestDependsOnAspNetRuntime>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!-- TestTemplateCreationFolder is the folder where the templates will be created. Will point out to $(OutputDir)$(TestTemplateCreationFolder) -->
<TestTemplateCreationFolder>TestTemplates\</TestTemplateCreationFolder>
<TestPackageRestorePath>$([MSBuild]::EnsureTrailingSlash('$(RepoRoot)'))obj\template-restore\</TestPackageRestorePath>
<TestDependsOnAspNetPackages>true</TestDependsOnAspNetPackages>
<TestDependsOnAspNetRuntime>true</TestDependsOnAspNetRuntime>
<TestDependsOnMssql>true</TestDependsOnMssql>
<TestDependsOnPlaywright>true</TestDependsOnPlaywright>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ProjectTemplates/test/ProjectTemplates.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- TestTemplateCreationFolder is the folder where the templates will be created. Will point out to $(OutputDir)$(TestTemplateCreationFolder) -->
<TestTemplateCreationFolder>TestTemplates\</TestTemplateCreationFolder>
<TestPackageRestorePath>$([MSBuild]::EnsureTrailingSlash('$(RepoRoot)'))obj\template-restore\</TestPackageRestorePath>
<TestDependsOnAspNetPackages>true</TestDependsOnAspNetPackages>
<TestDependsOnAspNetRuntime>true</TestDependsOnAspNetRuntime>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/SignalR/clients/ts/client-ts.npmproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<Project>
<PropertyGroup>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
<IsPackable>false</IsPackable>
<IsBuildable>false</IsBuildable>
<IsTestProject>true</IsTestProject>
<!-- Npm tests don't run on Helix currently, so we need to set this to false to still run the tests on non-Helix -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup>
Expand Down

0 comments on commit 07c6a62

Please sign in to comment.