Skip to content

Commit

Permalink
Harden smoketest to avoid ansible becoming a python dependency (#2926)
Browse files Browse the repository at this point in the history
Molecule drivers should never made ansible package as a dependency
as molecule itself is decoupled from Ansible python module.

This removes drivers that are prevent this decoupling.
  • Loading branch information
ssbarnea authored Oct 30, 2020
1 parent 2e5e608 commit 3e22a39
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions tools/smoketest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

ANSIBLE=$(pipdeptree --reverse -p ansible)

if [ -z "$ANSIBLE" ]; then
echo "Ansible dependency not detected."
else
echo "FATAL: Detected unexpected dependency on Ansible package"
echo "$ANSIBLE"
exit 2
fi
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
minversion = 3.9.0
minversion = 3.18.0
envlist =
lint
docs
Expand Down Expand Up @@ -34,7 +34,6 @@ passenv =
TERM
setenv =
ANSIBLE_CONFIG={toxinidir}/.ansible.cfg
ANSIBLE_CALLABLE_WHITELIST={env:ANSIBLE_CALLABLE_WHITELIST:timer,profile_roles}
ANSIBLE_DISPLAY_FAILED_STDERR=1
ANSIBLE_VERBOSITY=1
MOLECULE_NO_LOG=0
Expand Down Expand Up @@ -68,8 +67,7 @@ commands =
# html report is used by Zuul CI to display reports
python -m pytest lib/molecule/test/unit/ {env:_EXTRAS} {env:PYTEST_ADDOPTS:} {posargs}


whitelist_externals =
allowlist_externals =
find
rm
sh
Expand Down Expand Up @@ -143,7 +141,7 @@ deps =
commands_pre =
commands =
python ./tools/build-containers.py
whitelist_externals =
allowlist_externals =
sh

[testenv:packaging]
Expand Down Expand Up @@ -201,4 +199,6 @@ commands =
pipdeptree --reverse -e pip,pbr,six,setuptools,toml,urllib3
molecule --version
molecule drivers
# add `molecule doctor` once we implemnt it
bash ./tools/smoketest.sh
allowlist_externals =
bash

0 comments on commit 3e22a39

Please sign in to comment.