diff options
author | Fabio Baltieri <fabiobaltieri@google.com> | 2023-01-27 15:40:16 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-01-27 18:13:38 +0000 |
commit | e3862acfe8b3e9125cf3c74d0bdbee8a9b93b2fc (patch) | |
tree | 885b69a325eb539f5897a0839b37be2a3ba85a0c | |
parent | 7dc429e831c28abdca99cffc73222599f80128e3 (diff) | |
download | chrome-ec-e3862acfe8b3e9125cf3c74d0bdbee8a9b93b2fc.tar.gz |
util: check_zephyr_project_config: ignore west modules
Currently parse_modules load all Zephyr modules if west is installed on
the system, which breaks this presubmit check if it is run outside of
the chroot and west is installed. Fix that by passing EC_BASE as modules
instead of extra_modules, which prevents the west list to be parsed in
the first place.
BRANCH=none
BUG=none
TEST=./util/check_zephyr_project_config.py -d $( find -name '*.conf' )
Change-Id: I43ec7dff6c2b1a4e289d7afe4a9c807a2646f531
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4188745
Reviewed-by: Al Semjonovs <asemjonovs@google.com>
-rwxr-xr-x | util/check_zephyr_project_config.py | 2 | ||||
-rwxr-xr-x | util/check_zephyr_project_config_unittest.py | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/util/check_zephyr_project_config.py b/util/check_zephyr_project_config.py index 6a48e348fd..93a43ad02f 100755 --- a/util/check_zephyr_project_config.py +++ b/util/check_zephyr_project_config.py @@ -96,7 +96,7 @@ class KconfigCheck: """ with tempfile.TemporaryDirectory() as temp_dir: modules = zephyr_module.parse_modules( - ZEPHYR_BASE, extra_modules=[EC_BASE] + ZEPHYR_BASE, modules=[EC_BASE] ) kconfig = "" diff --git a/util/check_zephyr_project_config_unittest.py b/util/check_zephyr_project_config_unittest.py index 0229085725..ad28d8e128 100755 --- a/util/check_zephyr_project_config_unittest.py +++ b/util/check_zephyr_project_config_unittest.py @@ -52,7 +52,7 @@ class TestKconfigCheck(unittest.TestCase): parse_modules_mock.assert_called_once_with( check_zephyr_project_config.ZEPHYR_BASE, - extra_modules=[check_zephyr_project_config.EC_BASE], + modules=[check_zephyr_project_config.EC_BASE], ) process_kconfig_mock.assert_called_once_with("project", "meta") kconfig_mock.assert_called_once_with( @@ -83,9 +83,7 @@ class TestKconfigCheck(unittest.TestCase): kconfig_mock.assert_called_once_with(kconfig_path) self.assertEqual(process_kconfig_mock.call_count, 0) - parse_modules_mock.assert_called_once_with( - mock.ANY, extra_modules=mock.ANY - ) + parse_modules_mock.assert_called_once_with(mock.ANY, modules=mock.ANY) @mock.patch("pathlib.Path.is_file") @mock.patch("check_zephyr_project_config.KconfigCheck._init_kconfig") |