From 69e4d1d9172d26f2589b24d745a542a99763958a Mon Sep 17 00:00:00 2001 From: goodov <5928869+goodov@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:28:33 +0700 Subject: [PATCH] Report build statistics in a separate TC block. (#24975) --- build/commands/lib/util.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build/commands/lib/util.js b/build/commands/lib/util.js index 31f39dca88f1..d59c8dc88d20 100644 --- a/build/commands/lib/util.js +++ b/build/commands/lib/util.js @@ -744,6 +744,10 @@ const util = { // with debugging issues (e.g., slowness or remote-failures). options.env.AUTONINJA_BUILD_ID = buildId + // Collect build statistics into this variable to display in a separate TC + // block. + let buildStats = '' + if (config.isTeamcity) { // Parse output to display the build status and exact failure location. let hasError = false @@ -754,6 +758,8 @@ const util = { } if (hasError) { Log.error(line) + } else if (buildStats || /^(RBE Stats:|metric\s+count)\s+/.test(line)) { + buildStats += line + '\n' } else { console.log(line) if (Date.now() - lastStatusTime > 5000) { @@ -773,6 +779,12 @@ const util = { await util.runAsync('autoninja', ninjaOpts, options) Log.progressFinish(progressMessage) + + if (config.isTeamcity && buildStats) { + Log.progressScope('report build stats', () => { + console.log(buildStats) + }) + } }, generateXcodeWorkspace: () => {