diff options
author | Sebastian Wagner <sewagner@redhat.com> | 2021-09-03 18:06:34 +0200 |
---|---|---|
committer | Sebastian Wagner <sewagner@redhat.com> | 2021-09-07 10:20:34 +0200 |
commit | 7777603e8bb711a723379d04ef23070f55c22feb (patch) | |
tree | ecbdca04c24d4a9b8bbf1506f41e0d7e6dfac7c2 /qa/tasks/tests | |
parent | Merge PR #43012 into master (diff) | |
download | ceph-7777603e8bb711a723379d04ef23070f55c22feb.tar.xz ceph-7777603e8bb711a723379d04ef23070f55c22feb.zip |
qa: tox.ini: verify yaml syntax
Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
Diffstat (limited to 'qa/tasks/tests')
-rw-r--r-- | qa/tasks/tests/conftest.py | 12 | ||||
-rw-r--r-- | qa/tasks/tests/test_import_yaml.py | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/qa/tasks/tests/conftest.py b/qa/tasks/tests/conftest.py new file mode 100644 index 00000000000..7cc617a4132 --- /dev/null +++ b/qa/tasks/tests/conftest.py @@ -0,0 +1,12 @@ +import glob + + +def pytest_addoption(parser): + parser.addoption("--suite-dir", help="suite dir") + +def pytest_generate_tests(metafunc): + if "yaml_file" in metafunc.fixturenames: + suite_dir = metafunc.config.getoption("--suite-dir") + files = glob.glob(f"{suite_dir}/**/*.yaml", recursive=True) + + metafunc.parametrize("yaml_file", list(set(files))) diff --git a/qa/tasks/tests/test_import_yaml.py b/qa/tasks/tests/test_import_yaml.py new file mode 100644 index 00000000000..d6e0e2640c2 --- /dev/null +++ b/qa/tasks/tests/test_import_yaml.py @@ -0,0 +1,5 @@ +import yaml + + +def test_load_yaml(yaml_file): + yaml.safe_load(open(yaml_file)) |