From d406dbb0eb2923f37bdc561a55a1fc8f443b1849 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 8 Feb 2024 19:40:43 +0100 Subject: [PATCH] Use everest-core/config directory as source for config tests Add --everest-config-dir option Signed-off-by: Kai-Uwe Hermann --- tests/conftest.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 92b51143c..6bfe627dd 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,11 +8,18 @@ def pytest_addoption(parser): parser.addoption("--everest-prefix", action="store", default="../build/dist", help="everest prefix path; default = '../build/dist'") + parser.addoption("--everest-config-dir", action="store", default=None, + help="everest config directory path'") def pytest_configure(config): - everest_prefix = config.getoption('--everest-prefix') - everest_config_path = Path(everest_prefix) / 'etc/everest' + everest_config_dir = config.getoption('--everest-config-dir') + if not everest_config_dir: + everest_prefix = config.getoption('--everest-prefix') + everest_config_path = Path(everest_prefix).resolve().parent.parent / 'config' + else: + everest_config_path = Path(everest_config_dir) + print(f"EVerest config dir: {everest_config_path}") everest_configs = [path for path in everest_config_path.iterdir( ) if path.name.startswith('config-') and path.name.endswith('.yaml')] pytest.everest_configs = {}