From c4c71ea610e1a53f48a244b57b227b26402a5183 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 29 Oct 2020 14:17:11 +0000 Subject: [PATCH] Improved smoketest to avoid ansible as a dependency 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. --- tools/smoketest.sh | 11 +++++++++++ tox.ini | 12 ++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100755 tools/smoketest.sh diff --git a/tools/smoketest.sh b/tools/smoketest.sh new file mode 100755 index 0000000000..9bbd541eeb --- /dev/null +++ b/tools/smoketest.sh @@ -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 diff --git a/tox.ini b/tox.ini index 24b97bc16d..6565c6f1ec 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -minversion = 3.9.0 +minversion = 3.18.0 envlist = lint docs @@ -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 @@ -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 @@ -143,7 +141,7 @@ deps = commands_pre = commands = python ./tools/build-containers.py -whitelist_externals = +allowlist_externals = sh [testenv:packaging] @@ -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