From: Egor Chesakov Date: Thu, 28 Feb 2019 17:55:28 +0000 (-0800) Subject: Re-partition MSBuild test groups (#22885) X-Git-Tag: accepted/tizen/unified/20190813.215958~61^2~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39b643fa45e62cd016b36c173d6166c41d85f0f7;p=platform%2Fupstream%2Fcoreclr.git Re-partition MSBuild test groups (#22885) This changes a tests partitioning scheme of coreclr tests in several different ways: 1. Make the test groups are of equal (to some extent) sizes keeping the number of tests in one group less than 1000; 2. As a resulf of 1) this increases a number of groups needed for Pri0 tests to 3 and decreases a number of groups for Pri1 tests to 10; 3. This also changes a way of tests partitioning scheme is defined - instead of explicitly specifying MSBuild Include-patterns this defines a boundaries between test groups in a form of _StartsWith ItemGroup. Then I use StringComparer.Ordinal to pick tests that belong to a particular group. --- diff --git a/build-test.cmd b/build-test.cmd index 4dcab5a..f074584 100644 --- a/build-test.cmd +++ b/build-test.cmd @@ -296,19 +296,18 @@ REM See https://github.com/Microsoft/msbuild/issues/2993 set __SkipPackageRestore=false set __SkipTargetingPackBuild=false -set __BuildLoopCount=2 -set __TestGroupToBuild=1 +set __NumberOfTestGroups=3 -if %__Priority% GTR 0 (set __BuildLoopCount=16&set __TestGroupToBuild=2) -echo %__MsgPrefix%Building tests group %__TestGroupToBuild% with %__BuildLoopCount% subgroups +if %__Priority% GTR 0 (set __NumberOfTestGroups=10) +echo %__MsgPrefix%Building tests divided into %__NumberOfTestGroups% test groups -for /l %%G in (1, 1, %__BuildLoopCount%) do ( +for /l %%G in (1, 1, %__NumberOfTestGroups%) do ( set __MsbuildLog=/flp:Verbosity=normal;LogFile="%__BuildLog%";Append=!__AppendToLog! set __MsbuildWrn=/flp1:WarningsOnly;LogFile="%__BuildWrn%";Append=!__AppendToLog! set __MsbuildErr=/flp2:ErrorsOnly;LogFile="%__BuildErr%";Append=!__AppendToLog! - set TestBuildSlice=%%G + set __TestGroupToBuild=%%G echo Running: msbuild %__ProjectDir%\tests\build.proj !__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! %TargetsWindowsMsbuildArg% %__msbuildArgs% !__PriorityArg! %__UnprocessedBuildArgs% call "%__ProjectDir%\dotnet.cmd" msbuild %__ProjectDir%\tests\build.proj !__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! %TargetsWindowsMsbuildArg% %__msbuildArgs% !__PriorityArg! %__UnprocessedBuildArgs% diff --git a/build-test.sh b/build-test.sh index 87a185d..3b3ff61 100755 --- a/build-test.sh +++ b/build-test.sh @@ -312,22 +312,21 @@ build_MSBuild_projects() # __SkipPackageRestore and __SkipTargetingPackBuild used to control build by tests/src/dirs.proj export __SkipPackageRestore=false export __SkipTargetingPackBuild=false - export __BuildLoopCount=2 - export __TestGroupToBuild=1 + export __NumberOfTestGroups=3 + __AppendToLog=false if [ -n "$__priority1" ]; then - export __BuildLoopCount=16 - export __TestGroupToBuild=2 + export __NumberOfTestGroups=10 fi - for (( slice=1 ; slice <= __BuildLoopCount; slice = slice + 1 )) + for (( testGroupToBuild=1 ; testGroupToBuild <= __NumberOfTestGroups; testGroupToBuild = testGroupToBuild + 1 )) do __msbuildLog="\"/flp:Verbosity=normal;LogFile=${__BuildLog};Append=${__AppendToLog}\"" __msbuildWrn="\"/flp1:WarningsOnly;LogFile=${__BuildWrn};Append=${__AppendToLog}\"" __msbuildErr="\"/flp2:ErrorsOnly;LogFile=${__BuildErr};Append=${__AppendToLog}\"" - export TestBuildSlice=$slice + export __TestGroupToBuild=$testGroupToBuild # Generate build command buildArgs=("/nologo" "/verbosity:minimal" "/clp:Summary") @@ -341,7 +340,7 @@ build_MSBuild_projects() buildArgs+=("${__UnprocessedBuildArgs[@]}") nextCommand="\"$__ProjectRoot/dotnet.sh\" msbuild ${buildArgs[@]}" - echo "Building step '$stepName' slice=$slice via $nextCommand" + echo "Building step '$stepName' testGroupToBuild=$testGroupToBuild via $nextCommand" eval $nextCommand # Make sure everything is OK diff --git a/tests/src/dirs.proj b/tests/src/dirs.proj index e6ba17e..7c95bd7 100644 --- a/tests/src/dirs.proj +++ b/tests/src/dirs.proj @@ -33,218 +33,102 @@ - - - - - OSGroup=$(OSGroup) - + + + - - - OSGroup=$(OSGroup) - - + - + + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - + <_GroupStartsWith Include="JIT\Methodical\Boxing\callconv\_relinstance_il.ilproj"> + 2 + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - + <_GroupStartsWith Include="JIT\Regression\CLR-x86-JIT\V1-M12-Beta2\b35351\b35351.ilproj"> + 3 + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - + + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - + <_GroupStartsWith Include="JIT\CodeGenBringUpTests\DblNeg_ro.csproj"> + 2 + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - + <_GroupStartsWith Include="JIT\Directed\shift\uint32_d.csproj"> + 3 + - - - OSGroup=$(OSGroup) - - + <_GroupStartsWith Include="JIT\Methodical\AsgOp\r8\r8flat_cs_r.csproj"> + 4 + - - - OSGroup=$(OSGroup) - - + <_GroupStartsWith Include="JIT\Methodical\eh\finallyexec\tryCatchFinallyThrow_nonlocalexit4_ro.csproj"> + 5 + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - + <_GroupStartsWith Include="JIT\Regression\CLR-x86-JIT\V1-M09.5-PDC\b25701\b25701.ilproj"> + 6 + - - - OSGroup=$(OSGroup) - - + <_GroupStartsWith Include="JIT\Regression\JitBlue\GitHub_19171\GitHub_19171.csproj"> + 7 + - - - OSGroup=$(OSGroup) - - + <_GroupStartsWith Include="JIT\jit64\valuetypes\nullable\box-unbox\value\box-unbox-value030.csproj"> + 8 + - - - OSGroup=$(OSGroup) - + <_GroupStartsWith Include="Loader\classloader\TypeGeneratorTests\TypeGeneratorTest225\Generated225.ilproj"> + 9 + + + <_GroupStartsWith Include="Loader\classloader\generics\VSD\Class2_ImplicitOverrideVirtualNewslot.csproj"> + 10 + - - - OSGroup=$(OSGroup) - - + - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - - OSGroup=$(OSGroup) - - + + + <_GroupStartsWith>@(_GroupStartsWith->WithMetadataValue("GroupNumber", $(__TestGroupToBuild))) + <_GroupEndsWithExcl>@(_GroupStartsWith->WithMetadataValue("GroupNumber", $([MSBuild]::Add($(__TestGroupToBuild), 1)))) + + + + + True + + + + False + + + + False + + + + + OSGroup=$(OSGroup)