summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2023-04-21 09:35:03 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-21 22:00:52 +0000
commit568f7e5107ba04a0e3d975b1e9e98d9ee507aab4 (patch)
treec432fcc8f909da0ab52aa7abd3f460c3f7d331a7
parent130b93642de3fe8ec2f69cbd1ab994a6c243e3ac (diff)
downloadchrome-ec-568f7e5107ba04a0e3d975b1e9e98d9ee507aab4.tar.gz
zmake: Set ninja path explicitly in tests
The golden file logging tests expect ninja to be in /usr/bin/ninja, but on gitlab it has moved. BRANCH=None BUG=b:248508087, b:273639386 TEST=run_tests.sh Change-Id: I3da9587ac504c8fc89f8d414f96225ef89a23aa2 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4459595 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r--zephyr/zmake/tests/test_zmake.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/zephyr/zmake/tests/test_zmake.py b/zephyr/zmake/tests/test_zmake.py
index ca6632e075..54ecad076a 100644
--- a/zephyr/zmake/tests/test_zmake.py
+++ b/zephyr/zmake/tests/test_zmake.py
@@ -164,8 +164,11 @@ class TestFilters:
assert not recs
@staticmethod
- def test_filter_info(zmake_factory_from_dir, tmp_path):
+ def test_filter_info(zmake_factory_from_dir, tmp_path, monkeypatch):
"""Test what appears on the INFO level"""
+ monkeypatch.setattr(
+ os, "environ", {"TOOL_PATH_ninja": "/usr/bin/ninja"}
+ )
recs = do_test_with_log_level(zmake_factory_from_dir, logging.INFO)
# TODO: Remove sets and figure out how to check the lines are in the
# right order.
@@ -192,8 +195,11 @@ class TestFilters:
assert expected == set(recs)
@staticmethod
- def test_filter_debug(zmake_factory_from_dir, tmp_path):
+ def test_filter_debug(zmake_factory_from_dir, tmp_path, monkeypatch):
"""Test what appears on the DEBUG level"""
+ monkeypatch.setattr(
+ os, "environ", {"TOOL_PATH_ninja": "/usr/bin/ninja"}
+ )
recs = do_test_with_log_level(zmake_factory_from_dir, logging.DEBUG)
# TODO: Remove sets and figure out how to check the lines are in the
# right order.