Testinfra Verifier Doesnt Support the "directory Option"
schwatvogel opened this issue · 1 comments
schwatvogel commented
Issue Type
- Bug report
Molecule and Ansible details
ansible [core 2.13.4]
config file = None
configured module search path = ['/Users/xxx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /Users/xxx/projects/xxx/venv/lib/python3.9/site-packages/ansible
ansible collection location = /Users/xxx/.ansible/collections:/usr/share/ansible/collections
executable location = /Users/xxx/projects/xxx/venv/bin/ansible
python version = 3.9.12 (main, Mar 26 2022, 15:44:31) [Clang 13.1.6 (clang-1316.0.21.2)]
jinja version = 3.1.1
libyaml = True
molecule 4.0.2 using python 3.9
ansible:2.13.4
delegated:4.0.2 from molecule
docker:1.1.0 from molecule_docker requiring collections: community.docker>=1.9.1
Molecule installation method (one of):
- pip
Ansible installation method (one of):
- pip
Detail any linters or test runners used:
Desired Behavior
Testinfa Provider should read directory:
config option to be able to use shared Test for all scenarios:
Excerpt from molecule.yml
....
verifier:
name: testinfra
directory: ../../tests
Actual Behaviour
% molecule check
CRITICAL Failed to validate /Users/xxx/projects/xxxg/molecule/default/molecule.yml
["Additional properties are not allowed ('directory' was unexpected)"]
It is still referenced as a valid Parameter here and used in the code later on. But not in the unit tests here
@pytest.fixture
def _model_verifier_section_data():
return {
"verifier": {
"name": "testinfra",
"enabled": True,
"options": {"foo": "bar"},
"env": {"FOO": "foo", "FOO_BAR": "foo_bar"},
"additional_files_or_dirs": ["foo"],
}
}