From 08aa12a14e7593ec8be131039236ebc6b95010f9 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 9 Jun 2021 07:48:00 -0400 Subject: [PATCH] twister: remove toolchain test We now get toolchain from cmake and can operate even if the toolchain variant is not set in the envrionment, this test was verifying the old behavior, so remove. There is not much twister related here to test and the environment is not setup correctly to run all of this cmake code. We are testing twister after all. Signed-off-by: Anas Nashif --- scripts/tests/twister/conftest.py | 5 +++++ scripts/tests/twister/test_testsuite_class.py | 15 --------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/scripts/tests/twister/conftest.py b/scripts/tests/twister/conftest.py index 752041b8310..4717fd04ebc 100644 --- a/scripts/tests/twister/conftest.py +++ b/scripts/tests/twister/conftest.py @@ -13,6 +13,11 @@ ZEPHYR_BASE = os.getenv("ZEPHYR_BASE") sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/pylib/twister")) from twisterlib import TestSuite, TestInstance +def new_get_toolchain(*args, **kwargs): + return 'zephyr' + +TestSuite.get_toolchain = new_get_toolchain + @pytest.fixture(name='test_data') def _test_data(): """ Pytest fixture to load the test data directory""" diff --git a/scripts/tests/twister/test_testsuite_class.py b/scripts/tests/twister/test_testsuite_class.py index 37b60ae1417..704322b8002 100755 --- a/scripts/tests/twister/test_testsuite_class.py +++ b/scripts/tests/twister/test_testsuite_class.py @@ -63,21 +63,6 @@ def test_get_all_testcases(class_testsuite, all_testcases_dict): assert len(class_testsuite.get_all_tests()) == 19 assert sorted(class_testsuite.get_all_tests()) == sorted(expected_tests) -def test_get_toolchain(class_testsuite, monkeypatch, capsys): - """ Testing get_toolchain function of TestSuite class in Twister - Test 1 : Test toolchain returned by get_toolchain function is same as in the environment. - Test 2 : Monkeypatch to delete the ZEPHYR_TOOLCHAIN_VARIANT env var - and check if appropriate error is raised""" - monkeypatch.setenv("ZEPHYR_TOOLCHAIN_VARIANT", "zephyr") - toolchain = class_testsuite.get_toolchain() - assert toolchain in ["zephyr"] - - monkeypatch.delenv("ZEPHYR_TOOLCHAIN_VARIANT", raising=False) - with pytest.raises(SystemExit): - class_testsuite.get_toolchain() - out, _ = capsys.readouterr() - assert out == "E: Variable ZEPHYR_TOOLCHAIN_VARIANT is not defined\n" - def test_get_platforms(class_testsuite, platforms_list): """ Testing get_platforms function of TestSuite class in Twister """ class_testsuite.platforms = platforms_list