-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Issue Description
Attempting to run multiple unit tests in parallel for a test project with multiple target frameworks. However, there is no way to do this out of the box. The DispatchToInnerBuildsWithVSTestTarget target in Microsoft.Common.CrossTargeting.targets\ImportAfter\Microsoft.TestPlatform.CrossTargeting.targets that recursively calls VSTest does not set the BuildInParallel option on the MSBuild task. Exerpt from version 5.0.302 of the sdk:
<Target Name="DispatchToInnerBuildsWithVSTestTarget" Returns="@(InnerOutput)">
<ItemGroup>
<_TargetFramework Include="$(TargetFrameworks)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFile)"
Condition="'$(TargetFrameworks)' != '' "
Targets="$(InnerVSTestTargets)"
Properties="TargetFramework=%(_TargetFramework.Identity);VSTestNoBuild=true"
ContinueOnError="ErrorAndContinue">
<Output ItemName="InnerOutput" TaskParameter="TargetOutputs" />
</MSBuild>
</Target>
Steps to Reproduce
- Create a new mstest project, e.g.
dotnet new mstest - enable multiple target frameworks for the test, with
<TargetFrameworks>net462;netcoreapp2.1;net5.0</TargetFrameworks> - run
dotnet testordotnet msbuild /restore /t:VSTest /p:TestInParallel=true
Expected
Tests for each targetframework run in parallel, as long as the user selects the appropriate command line option or configuration.
Actual
Tests never run in parallel.
Data
Analysis
Versions & Configurations
aaronla@aaronla-rabbit:PowerPlatform$ dotnet --version
5.0.302
aaronla@aaronla-rabbit:PowerPlatform$ dotnet msbuild --nologo --version
16.10.2.30804
Regression?
Attach a binlog
0xced