Skip to content

Commit

Permalink
[build] Generate separate .binlog files for tests. (#2001)
Browse files Browse the repository at this point in the history
Context: #1792
Context: 987a05f

Commit 987a05f 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 987a05f 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 987a05f:
`.binlog` files for diagnostic output, with "normal" output printed to
the console, resulting in smaller Jenkins log files -- ~26MB now.
  • Loading branch information
jonpryor authored Oct 11, 2018
1 parent e6044b0 commit 319158f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
24 changes: 20 additions & 4 deletions build-tools/scripts/RunTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<_NUnit>$(_Runtime) packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe</_NUnit>
<_Test Condition=" '$(TEST)' != '' ">--test=&quot;$(TEST)&quot;</_Test>
<_XABuild>$(_TopDir)\bin\$(Configuration)\bin\xabuild</_XABuild>
<_XABuildDiag Condition=" '$(V)' != '' ">/v:diag </_XABuildDiag>
<_XABinLogPrefix>/v:normal /binaryLogger:"$(MSBuildThisFileDirectory)\..\..\bin\Build$(Configuration)\msbuild</_XABinLogPrefix>
<_XABuildDiag Condition=" '$(USE_MSBUILD)' == '0' And '$(V)' != '' ">/v:diag </_XABuildDiag>
<_XABuildProperties>$(_XABuildDiag)/p:Configuration=$(Configuration) /p:XAIntegratedTests=$(XAIntegratedTests)</_XABuildProperties>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -92,13 +93,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 @@ -107,8 +118,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
8 changes: 4 additions & 4 deletions build-tools/scripts/msbuild.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ else # $(OS_NAME) != Darwin
_PKG_CONFIG = pkg-config
endif # $(OS_NAME) == Darwin

ifneq ($(V),0)
MSBUILD_FLAGS += /v:diag
endif # $(V) != 0

ifeq ($(MSBUILD),msbuild)
export USE_MSBUILD = 1
endif # $(MSBUILD) == msbuild
Expand All @@ -55,6 +51,10 @@ else # $(_CSC_EMITS_PDB) == ''
MSBUILD_FLAGS += /p:_DebugFileExt=.mdb
endif # $(_CSC_EMITS_PDB) == Pdb

ifneq ($(V),0)
MSBUILD_FLAGS += /v:diag
endif # $(V) != 0

# $(call MSBUILD_BINLOG,name,msbuild=$(MSBUILD),conf=$(CONFIGURATION))
define MSBUILD_BINLOG
$(if $(2),$(2),$(MSBUILD)) $(MSBUILD_FLAGS)
Expand Down

0 comments on commit 319158f

Please sign in to comment.