Skip to content

Commit

Permalink
Use everest-core/config directory as source for config tests
Browse files Browse the repository at this point in the history
Add --everest-config-dir option

Signed-off-by: Kai-Uwe Hermann <[email protected]>
  • Loading branch information
hikinggrass committed Feb 8, 2024
1 parent 5991fdc commit d406dbb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit d406dbb

Please sign in to comment.