summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Fagerburg <pfagerburg@google.com>2021-02-26 07:56:22 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-26 17:22:07 +0000
commitaabb2eaae226e915eeac8158c60f4c83f621f6ac (patch)
tree9d2e03e2be0de757e8c3d4b046a2f902a69a68ab
parent8f1f03521cb5eeb3fdf647ab00ac4b65a11808d5 (diff)
downloadchrome-ec-aabb2eaae226e915eeac8158c60f4c83f621f6ac.tar.gz
firmware_builder: always create metrics file
The firmware builder doesn't need to do anything for code coverage, except that it still needs to create a metrics file so that the postsubmit builder can find it. BUG=chromium:1182320 BRANCH=None TEST=firmware-ec-cov-cq succeeds Cq-Include-Tryjobs: chromeos/cq:firmware-ec-cov-cq Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: Id1a4ac5cee1ba4bfbfb2f68ce937386658abfa4f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2722554 Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: LaMont Jones <lamontjones@chromium.org> Reviewed-by: Sean McAllister <smcallis@google.com>
-rwxr-xr-xfirmware_builder.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/firmware_builder.py b/firmware_builder.py
index b85e9f7be2..0ae9604f34 100755
--- a/firmware_builder.py
+++ b/firmware_builder.py
@@ -32,17 +32,19 @@ def build(opts):
need this step. It builds EC **firmware** targets, but unit tests with
code coverage are all host-based. So if the --code-coverage flag is set,
we don't need to build the firmware targets and we can return without
- doing anything but giving an informational message.
+ doing anything but creating the metrics file and giving an informational
+ message.
"""
+ # TODO(b/169178847): Add appropriate metric information
+ metrics = firmware_pb2.FwBuildMetricList()
+ with open(opts.metrics, 'w') as f:
+ f.write(json_format.MessageToJson(metrics))
+
if opts.code_coverage:
print("When --code-coverage is selected, 'build' is a no-op. "
"Run 'test' with --code-coverage instead.")
return
- # TODO(b/169178847): Add appropriate metric information
- metrics = firmware_pb2.FwBuildMetricList()
- with open(opts.metrics, 'w') as f:
- f.write(json_format.MessageToJson(metrics))
subprocess.run(['make', 'buildall_only', '-j{}'.format(opts.cpus)],
cwd=os.path.dirname(__file__),
check=True)