Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Run MSBuild in parallel when submitting jobs to Helix (#21390)
Browse files Browse the repository at this point in the history
  • Loading branch information
echesakov authored Dec 6, 2018
1 parent 5955967 commit 2161d9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions eng/test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:

# 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') }}:
Expand All @@ -123,7 +123,7 @@ jobs:
# 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') }}:
Expand Down
21 changes: 9 additions & 12 deletions tests/helixpublishwitharcade.proj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<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,
Expand Down Expand Up @@ -51,20 +51,17 @@
<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"
Expand Down

0 comments on commit 2161d9d

Please sign in to comment.