Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Commit 2584149

Browse files
committed
testing: enforce use of internal inventory
Avoids case where user system config could change outcome of testing. Adds "driver_error" marker to molecule scenarios that have drivers that did not pass our checks. This avoids case where some pytest-molecule tests are skipped accidentally.
1 parent 639600a commit 2584149

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/hosts.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
localhost ansible_connection=local

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ commands =
2828
pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} --molecule-unavailable-driver= -k foo
2929
setenv =
3030
ANSIBLE_FORCE_COLOR={env:ANSIBLE_FORCE_COLOR:1}
31-
ANSIBLE_INVENTORY={env:ANSIBLE_INVENTORY:{toxinidir}/../zuul-infra/inventory.yml}
31+
# ANSIBLE_INVENTORY={env:ANSIBLE_INVENTORY:{toxinidir}/../zuul-infra/inventory.yml}
32+
ANSIBLE_INVENTORY={env:ANSIBLE_INVENTORY:{toxinidir}/tests/hosts.ini}
3233
ANSIBLE_CONFIG={toxinidir}/ansible.cfg
3334
ANSIBLE_NOCOWS=1
3435
ANSIBLE_RETRY_FILES_ENABLED=0
@@ -64,7 +65,7 @@ commands =
6465
--source \
6566
--binary \
6667
--out-dir {toxinidir}/dist/ {toxinidir}
67-
pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} tests/roles/ensure-ansible
68+
pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} --molecule-unavailable-driver=driver_error tests/roles/ensure-ansible
6869

6970
[testenv:devel]
7071
description: Unit testing using master branch of molecule

0 commit comments

Comments
 (0)