multi-proc test execution

This commit is contained in:
Piotr Puszkiewicz 2016-08-09 15:19:34 -07:00
parent e08da40a1f
commit 43c5a2c59b
4 changed files with 49 additions and 34 deletions

View file

@ -5,14 +5,14 @@
<PropertyGroup>
<BinaryToCorehostifyRelDir>runtimes/any/native</BinaryToCorehostifyRelDir>
<CoreSDKDir>$(RepoRoot)/resources/MSBuildImports</CoreSDKDir>
<MSBuildImportsDir>$(RepoRoot)/resources/MSBuildImports</MSBuildImportsDir>
</PropertyGroup>
<ItemGroup>
<PublishOutputExtensions Include="$(ExeExtension);.dll;.pdb;.deps.json;.runtimeconfig.json" />
<FilesToMove Include="$(BinaryToCorehostifyRelDir)/csc.exe;$(BinaryToCorehostifyRelDir)/MSBuild.exe;" />
<BundledTools Include="csc;MSBuild;NuGet.CommandLine.XPlat;dotnet" />
<CoreSDKContent Include="$(CoreSDKDir)/**/*" />
<MSBuildImportsContent Include="$(MSBuildImportsDir)/**/*" />
</ItemGroup>
<Target Name="Compile" DependsOnTargets="Prepare;
@ -165,7 +165,7 @@
DestinationFiles="$(SdkOutputDirectory)/$(HostPolicyBaseName)" />
<!-- copy core sdk -->
<Copy SourceFiles="@(CoreSDKContent)"
<Copy SourceFiles="@(MSBuildImportsContent)"
DestinationFolder="$(SdkOutputDirectory)/%(RecursiveDir)" />
<!-- Crossgen the Shared Framework -->

View file

@ -27,13 +27,28 @@
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsEnv)" />
</ItemGroup>
<DotNetTest WorkingDirectory="%(TestProjects.ProjectDir)"
EnvironmentVariables="@(TestTaskEnvironmentVariables)"
ToolPath="$(Stage2Directory)"
Configuration="$(Configuration)"
NoBuild="True"
NoTrait="category=failing"
Xml="$(TestResultXmlDir)/%(TestProjects.OutputName)-testResults.xml" />
<PropertyGroup>
<RunTestEnvironmentVariables>@(TestTaskEnvironmentVariables)</RunTestEnvironmentVariables>
</PropertyGroup>
<ItemGroup>
<ProjectsToTest Include="build/test/RunTest.proj">
<Properties>
CLIBuildDll=$(CLIBuildDll);
Configuration=$(Configuration);
EnvironmentVariables=$(RunTestEnvironmentVariables);
TestProjectName=%(TestProjects.OutputName);
TestResultXmlDir=$(TestResultXmlDir);
ToolPath=$(Stage2Directory);
WorkingDirectory=%(TestProjects.ProjectDir)
</Properties>
</ProjectsToTest>
</ItemGroup>
<MSBuild
BuildInParallel="True"
Projects="@(ProjectsToTest)">
</MSBuild>
</Target>
<Target Name="PrepareTests"

View file

@ -71,10 +71,10 @@ $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
if ($NoBuild)
{
Write-Host "Not building due to --nobuild"
Write-Host "Command that would be run: 'dotnet build3 build.proj /p:Architecture=$Architecture $ExtraParameters'"
Write-Host "Command that would be run: 'dotnet build3 build.proj /m /p:Architecture=$Architecture $ExtraParameters'"
}
else
{
dotnet build3 build.proj /p:Architecture=$Architecture $ExtraParameters
dotnet build3 build.proj /m /p:Architecture=$Architecture $ExtraParameters
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
}

View file

@ -117,8 +117,8 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
echo "${args[@]}"
if [ $BUILD -eq 1 ]; then
dotnet build3 build.proj /p:Architecture=$ARCHITECTURE "${args[@]}"
dotnet build3 build.proj /m /p:Architecture=$ARCHITECTURE "${args[@]}"
else
echo "Not building due to --nobuild"
echo "Command that would be run is: 'dotnet build3 build.proj /p:Architecture=$ARCHITECTURE ${args[@]}'"
echo "Command that would be run is: 'dotnet build3 build.proj /m /p:Architecture=$ARCHITECTURE ${args[@]}'"
fi