-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor config_tests to automatically run all configs found
Signed-off-by: Kai-Uwe Hermann <[email protected]>
- Loading branch information
1 parent
6486a49
commit bb8128c
Showing
3 changed files
with
37 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright 2020 - 2023 Pionix GmbH and Contributors to EVerest | ||
# Copyright Pionix GmbH and Contributors to EVerest | ||
|
||
from pathlib import Path | ||
import pytest | ||
|
||
import os | ||
|
||
def pytest_addoption(parser): | ||
parser.addoption("--everest-prefix", action="store", default="../build/dist", | ||
help="everest prefix path; default = '../build/dist'") | ||
|
||
|
||
def pytest_configure(config): | ||
everest_prefix = config.getoption('--everest-prefix') | ||
everest_config_path = Path(everest_prefix) / 'etc/everest' | ||
everest_configs = [path for path in everest_config_path.iterdir( | ||
) if path.name.startswith('config-') and path.name.endswith('yaml')] | ||
pytest.everest_configs = {} | ||
pytest.everest_configs['params'] = [] | ||
pytest.everest_configs['ids'] = [] | ||
for config_path in everest_configs: | ||
config_id = config_path.stem | ||
if config_id == 'config-sil-gen-pm': | ||
# skip | ||
continue | ||
pytest.everest_configs['params'].append(config_path) | ||
pytest.everest_configs['ids'].append(config_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters