# Send tests to helix
- ${{ if or(eq(parameters.osGroup, 'Linux'), eq(parameters.osGroup, 'OSX')) }}:
- - script: ./Tools/dotnetcli/dotnet msbuild tests/helixpublishwitharcade.proj /t:Test $(scenariosArg)
+ - script: ./Tools/dotnetcli/dotnet msbuild tests/helixpublishwitharcade.proj /maxcpucount $(scenariosArg)
displayName: Send test jobs to Helix
env:
${{ if eq(variables['System.TeamProject'], 'internal') }}:
# Access token variable for public project
HelixAccessToken: $(BotAccount-dotnet-github-anon-kaonashi-bot-helix-token)
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- - script: .\Tools\dotnetcli\dotnet msbuild tests\helixpublishwitharcade.proj /t:Test $(scenariosArg)
+ - script: .\Tools\dotnetcli\dotnet msbuild tests\helixpublishwitharcade.proj /maxcpucount $(scenariosArg)
displayName: Send test jobs to Helix
env:
${{ if eq(variables['System.TeamProject'], 'internal') }}:
-<Project Sdk="Microsoft.DotNet.Helix.Sdk">
+<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="SubmitTestsToHelix">
<!-- This project uses the helix SDK ,documented at
https://github.com/dotnet/arcade/tree/master/src/Microsoft.DotNet.Helix/Sdk,
<Target Name="SubmitTestsToHelix">
<ItemGroup>
<Scenarios Include="$(Scenarios)" />
+ <ProjectsToBuild Include="$(MSBuildProjectFile)">
+ <Properties>Scenario=%(Scenarios.Identity)</Properties>
+ </ProjectsToBuild>
</ItemGroup>
- <!-- If no scenario was specified, just run the normal test
- scenario -->
- <MSBuild Projects="$(MSBuildProjectFile)" Targets="Test"
- Condition=" '@(Scenarios->Count())' == '0' " />
-
- <!-- If scenarios were specified, submit jobs for each
- scenario. -->
- <MSBuild Projects="$(MSBuildProjectFile)" Targets="Test"
- Properties="Scenario=%(Scenarios.Identity)"
- BuildInParallel="true"
- Condition=" '@(Scenarios->Count())' != '0' " />
+ <PropertyGroup>
+ <BuildInParallel>false</BuildInParallel>
+ <BuildInParallel Condition=" '@(ProjectsToBuild->Count())' > '1' ">true</BuildInParallel>
+ </PropertyGroup>
+ <MSBuild Projects="@(ProjectsToBuild)" Targets="Test" BuildInParallel="$(BuildInParallel)" StopOnFirstFailure="false" UnloadProjectsOnCompletion="true" />
</Target>
<Target Name="BuildHelixWorkItem"