diff options
author | Tristan Honscheid <honscheid@google.com> | 2022-08-04 15:01:02 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-08-05 21:48:50 +0000 |
commit | 1e869d9431dbae9b0753bf506ff08425d0afe6c1 (patch) | |
tree | f0e6cdde1d68f458fd26dda93ad9c7b0850ac26f | |
parent | 8837bd3f14c0af1d221316bf1126ec22066fe054 (diff) | |
download | chrome-ec-1e869d9431dbae9b0753bf506ff08425d0afe6c1.tar.gz |
zephyr: tests: remove BUILD.py for Zephyr EC unit tests
We have completed transitioning tests to Twister and verified parity in
coverage reports between this and the previous version. This CL
removes the BUILD.py files from our tests that declare the zmake
projects and removes the call to `zmake -D test -a --no-rebuild` from
`zephyr/firmware-builder.py` The `EC_ZEPHYR_MERGED` metric is now
derived from Twister's coverage data instead. Made corresponding changes
to `.gitlab-ci.yml`
This CL was tested by comparing the total coverage and list of covered
files before and after the change.
BUG=b:240093007
BRANCH=None
TEST=zephyr/firmware-builder.py --code-coverage {build|test|bundle}
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Change-Id: I865a22a44f56760790444499c7588f7aec299374
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3811956
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
-rw-r--r-- | .gitlab-ci.yml | 13 | ||||
-rwxr-xr-x | zephyr/firmware_builder.py | 13 | ||||
-rw-r--r-- | zephyr/test/accel_cal/BUILD.py | 7 | ||||
-rw-r--r-- | zephyr/test/ap_power/BUILD.py | 7 | ||||
-rw-r--r-- | zephyr/test/base32/BUILD.py | 7 | ||||
-rw-r--r-- | zephyr/test/crc/BUILD.py | 7 | ||||
-rw-r--r-- | zephyr/test/drivers/BUILD.py | 44 | ||||
-rw-r--r-- | zephyr/test/ec_app/BUILD.py | 9 | ||||
-rw-r--r-- | zephyr/test/hooks/BUILD.py | 7 | ||||
-rw-r--r-- | zephyr/test/i2c/BUILD.py | 7 | ||||
-rw-r--r-- | zephyr/test/i2c_dts/BUILD.py | 9 | ||||
-rw-r--r-- | zephyr/test/math/BUILD.py | 13 | ||||
-rw-r--r-- | zephyr/test/system/BUILD.py | 9 | ||||
-rw-r--r-- | zephyr/test/tasks/BUILD.py | 7 |
14 files changed, 11 insertions, 148 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a3f8c4cfbc..77872288df 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -230,12 +230,11 @@ zephyr_coverage: stage: test needs: ["seed_cache"] script: - - zmake --zephyr-base "${ZEPHYR_BASE}" - --modules-dir "${MODULES_DIR}" -l DEBUG test - --coverage --host-tests-only + - ${EC_DIR}/twister --coverage --outdir "${EC_DIR}/twister-out/" + -p native_posix artifacts: paths: - - build/zephyr/all_tests.info + - ${EC_DIR}/twister-out/coverage.info expire_in: 1 week coverage: '/lines\.*: \d+\.\d+%/' @@ -259,7 +258,7 @@ merged_coverage: needs: ["ec_coverage", "zephyr_coverage", "zephyr_boards_coverage"] script: - lcov --rc lcov_branch_coverage=1 -o build/merged.info - -a build/coverage/lcov.info -a build/zephyr/all_tests.info + -a build/coverage/lcov.info -a "${EC_DIR}/twister-out/coverage.info" - lcov --rc lcov_branch_coverage=1 -o build/merged_no_zephyr.info -r build/merged.info "${ZEPHYR_BASE}/**" "${MODULES_DIR}/**" @@ -302,8 +301,8 @@ testall: stage: test needs: ["seed_cache"] script: - - zmake --zephyr-base "${ZEPHYR_BASE}" - --modules-dir "${MODULES_DIR}" -l DEBUG test --host-tests-only + - ${EC_DIR}/twister --coverage --outdir "${EC_DIR}/twister-out/" + -p native_posix twister_coverage: stage: test diff --git a/zephyr/firmware_builder.py b/zephyr/firmware_builder.py index e49d2d4e16..9721d36121 100755 --- a/zephyr/firmware_builder.py +++ b/zephyr/firmware_builder.py @@ -209,11 +209,6 @@ def test(opts): [zephyr_dir / "zmake" / "run_tests.sh"], check=True, cwd=zephyr_dir ) - cmd = ["zmake", "-D", "test", "-a", "--no-rebuild"] - if opts.code_coverage: - cmd.append("--coverage") - subprocess.run(cmd, check=True, cwd=zephyr_dir) - # Twister-based tests platform_ec = zephyr_dir.parent run_twister(platform_ec, opts.code_coverage, ["--test-only"]) @@ -228,8 +223,6 @@ def test(opts): "--rc", "lcov_branch_coverage=1", "-a", - build_dir / "all_tests.info", - "-a", build_dir / "all_builds.info", "-a", platform_ec / "twister-out" / "coverage.info", @@ -244,7 +237,11 @@ def test(opts): _extract_lcov_summary("EC_ZEPHYR_MERGED", metrics, output) output = subprocess.run( - ["/usr/bin/lcov", "--summary", build_dir / "all_tests.info"], + [ + "/usr/bin/lcov", + "--summary", + platform_ec / "twister-out" / "coverage.info", + ], cwd=zephyr_dir, check=True, stdout=subprocess.PIPE, diff --git a/zephyr/test/accel_cal/BUILD.py b/zephyr/test/accel_cal/BUILD.py deleted file mode 100644 index 7db25e03a4..0000000000 --- a/zephyr/test/accel_cal/BUILD.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for accel_cal test.""" - -register_host_test("accel_cal", dts_overlays=["boards/native_posix.overlay"]) diff --git a/zephyr/test/ap_power/BUILD.py b/zephyr/test/ap_power/BUILD.py deleted file mode 100644 index 633764bc2b..0000000000 --- a/zephyr/test/ap_power/BUILD.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2022 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for ap_power test.""" - -register_host_test("ap_power", dts_overlays=["boards/native_posix.overlay"]) diff --git a/zephyr/test/base32/BUILD.py b/zephyr/test/base32/BUILD.py deleted file mode 100644 index 16546ba9a8..0000000000 --- a/zephyr/test/base32/BUILD.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for base32 test.""" - -register_host_test("base32", dts_overlays=["boards/native_posix.overlay"]) diff --git a/zephyr/test/crc/BUILD.py b/zephyr/test/crc/BUILD.py deleted file mode 100644 index 0f79a318c6..0000000000 --- a/zephyr/test/crc/BUILD.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for crc test.""" - -register_host_test("crc", dts_overlays=[here / "boards/native_posix.overlay"]) diff --git a/zephyr/test/drivers/BUILD.py b/zephyr/test/drivers/BUILD.py deleted file mode 100644 index 55ce254650..0000000000 --- a/zephyr/test/drivers/BUILD.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Construct the drivers test binaries""" - - -drivers = register_host_test( - test_name="drivers", - dts_overlays=[ - here / "boards/native_posix.overlay", - ], - kconfig_files=[ - here / "prj.conf", - ], -) - -# Per Suite Builds - -ap_mux_control = drivers.variant( - project_name="test-drivers-ap_mux_control", - kconfig_files=[here / "ap_mux_control" / "prj.conf"], -) - -chargesplash = drivers.variant( - project_name="test-drivers-chargesplash", -) - -isl923x = drivers.variant( - project_name="test-drivers-isl923x", -) - -usbc_alt_mode = drivers.variant( - project_name="test-drivers-usbc_alt_mode", -) - -led_driver = drivers.variant( - project_name="test-drivers-led_driver", - dts_overlays=[ - here / "led_driver" / "led_pins.dts", - here / "led_driver" / "led_policy.dts", - ], - kconfig_files=[here / "led_driver" / "prj.conf"], -) diff --git a/zephyr/test/ec_app/BUILD.py b/zephyr/test/ec_app/BUILD.py deleted file mode 100644 index aa5907f6a8..0000000000 --- a/zephyr/test/ec_app/BUILD.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for ec_app test.""" - -register_host_test( - "ec_app", dts_overlays=[here / "boards/native_posix.overlay"] -) diff --git a/zephyr/test/hooks/BUILD.py b/zephyr/test/hooks/BUILD.py deleted file mode 100644 index e3bb97208f..0000000000 --- a/zephyr/test/hooks/BUILD.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for hooks test.""" - -register_host_test("hooks", dts_overlays=[here / "boards/native_posix.overlay"]) diff --git a/zephyr/test/i2c/BUILD.py b/zephyr/test/i2c/BUILD.py deleted file mode 100644 index 0296b9f93e..0000000000 --- a/zephyr/test/i2c/BUILD.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for i2c test.""" - -register_host_test("i2c", dts_overlays=[here / "boards/native_posix.overlay"]) diff --git a/zephyr/test/i2c_dts/BUILD.py b/zephyr/test/i2c_dts/BUILD.py deleted file mode 100644 index 634f49db9f..0000000000 --- a/zephyr/test/i2c_dts/BUILD.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for i2c_dts test.""" - -register_host_test( - "i2c_dts", dts_overlays=[here / "boards/native_posix.overlay"] -) diff --git a/zephyr/test/math/BUILD.py b/zephyr/test/math/BUILD.py deleted file mode 100644 index fb93f5269d..0000000000 --- a/zephyr/test/math/BUILD.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2022 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for math tests.""" - -register_host_test( - "math_fixed", kconfig_files=[here / "prj.conf", here / "fixed_point.conf"] -) -register_host_test( - "math_float", - kconfig_files=[here / "prj.conf", here / "floating_point.conf"], -) diff --git a/zephyr/test/system/BUILD.py b/zephyr/test/system/BUILD.py deleted file mode 100644 index 39fc3b5345..0000000000 --- a/zephyr/test/system/BUILD.py +++ /dev/null @@ -1,9 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for system test.""" - -register_host_test( - "system", dts_overlays=[here / "boards/native_posix.overlay"] -) diff --git a/zephyr/test/tasks/BUILD.py b/zephyr/test/tasks/BUILD.py deleted file mode 100644 index 156a478a25..0000000000 --- a/zephyr/test/tasks/BUILD.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2021 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -"""Register zmake project for tasks test.""" - -register_host_test("tasks", dts_overlays=[here / "boards/native_posix.overlay"]) |