Skip to content

Commit

Permalink
[build] Generate separate .binlog files for tests.
Browse files Browse the repository at this point in the history
Context: dotnet#1792
Context: 944092d99540bb9a6106175404c17cf4fddce394

Commit 944092d9 updated the "normal" build log process, as used by
Jenkins/etc., so that Console output received "normal" build verbosity
messages, while MSBuild `.binlog` files would be generated so that
"diagnostic" build logs could be produced "later," as necessary.

Unfortunately, commit 944092d9 didn't update unit test builds.
Consequently, `make run-apk-tests`/etc. would emit *diagnostic* build
logs to the Console, meaning instead of the previous ~1GB log file, we
instead had a "mere" ~400MB instead.

Update test execution so that they follow the spirit of 944092d9:
`.binlog` files for diagnostic output, with "normal" output printed to
the console, resulting in smaller Jenkins log files.
  • Loading branch information
jonpryor committed Jul 25, 2018
1 parent 781f4b2 commit 911d2de
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions build-tools/scripts/RunTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<_XABuild>$(_TopDir)\bin\$(Configuration)\bin\xabuild</_XABuild>
<_XABuildDiag Condition=" '$(V)' != '' ">/v:diag </_XABuildDiag>
<_XABuildProperties>$(_XABuildDiag)/p:Configuration=$(Configuration) /p:XAIntegratedTests=$(XAIntegratedTests)</_XABuildProperties>
<_XABinLogPrefix>/v:normal /binaryLogger:"$(MSBuildThisFileDirectory)\..\..\bin\Build$(Configuration)\msbuild</_XABinLogPrefix>
</PropertyGroup>
<ItemGroup>
<_TestAssembly Include="$(_TopDir)\bin\Test$(Configuration)\Xamarin.Android.Build.Tests.dll" />
Expand Down Expand Up @@ -88,13 +89,23 @@
<Delete Files="@(_JavaInteropTestResults)" />
</Target>
<Target Name="RunApkTests">
<Exec Command="$(_XABuild) %(_ApkTestProject.Identity) /t:SignAndroidPackage $(_XABuildProperties)" />
<ItemGroup Condition=" '$(USE_MSBUILD)' == '1' ">
<_ApkTestProject>
<_BinLog>$(_XABinLogPrefix)-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss"))-%(Filename).binlog"</_BinLog>
</_ApkTestProject>
</ItemGroup>
<Exec Command="$(_XABuild) %(_ApkTestProject.Identity) %(_ApkTestProject._BinLog) /t:SignAndroidPackage $(_XABuildProperties)" />
<MSBuild
ContinueOnError="ErrorAndContinue"
Projects="$(_TopDir)\tests\RunApkTests.targets"
/>
<ItemGroup Condition=" '$(USE_MSBUILD)' == '1' ">
<_ApkTestProjectAot>
<_BinLog>$(_XABinLogPrefix)-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss"))-%(Filename)-AOT.binlog"</_BinLog>
</_ApkTestProjectAot>
</ItemGroup>
<Exec
Command="$(_XABuild) %(_ApkTestProjectAot.Identity) /t:SignAndroidPackage $(_XABuildProperties) /p:AotAssemblies=True"
Command="$(_XABuild) %(_ApkTestProjectAot.Identity) %(_ApkTestProjectAot._BinLog) /t:SignAndroidPackage $(_XABuildProperties) /p:AotAssemblies=True"
Condition=" '$(Configuration)' == 'Release' "
/>
<MSBuild
Expand All @@ -103,8 +114,13 @@
Condition=" '$(Configuration)' == 'Release' "
Properties="AotAssemblies=True"
/>
<ItemGroup Condition=" '$(USE_MSBUILD)' == '1' ">
<_ApkTestProjectBundle>
<_BinLog>$(_XABinLogPrefix)-$([System.DateTime]::Now.ToString ("yyyyMMddTHHmmss"))-%(Filename)-Bundle.binlog"</_BinLog>
</_ApkTestProjectBundle>
</ItemGroup>
<Exec
Command="$(_XABuild) %(_ApkTestProjectBundle.Identity) /t:SignAndroidPackage $(_XABuildProperties) /p:BundleAssemblies=True /p:EmbedAssembliesIntoApk=True"
Command="$(_XABuild) %(_ApkTestProjectBundle.Identity) %(_ApkTestProjectBundle._BinLog) /t:SignAndroidPackage $(_XABuildProperties) /p:BundleAssemblies=True /p:EmbedAssembliesIntoApk=True"
Condition=" '$(Configuration)' == 'Release' "
/>
<MSBuild
Expand Down

0 comments on commit 911d2de

Please sign in to comment.