Skip to content

Commit

Permalink
Assures we use venv with ansible-test (#93)
Browse files Browse the repository at this point in the history
This fixed bug where ansible-test executions were hard to
reproduce across different machines and where user installed
packages may influence the outcome.
  • Loading branch information
ssbarnea authored Jul 26, 2021
1 parent 5c4465c commit 9127a42
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/tox_ansible/ansible/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,29 @@ def tox_cases(self):
# pylint: disable=fixme
# TODO(ssbarnea): Detect and enable only those tests that do exist
# to avoid confusing tox user.
#
# We use --venv because otherwise we risk getting errors from the
# system environment, especially as one of tests performed is
# 'pip check'.
ANSIBLE_TEST_COMMANDS: Dict[str, Dict[str, Any]] = {
"integration": {
"args": ["--requirements"],
"args": ["--requirements", "--venv"],
"requires": "tests/integration",
},
"network-integration": {
"args": ["--requirements"],
"args": ["--requirements", "--venv"],
"requires": "tests/network-integration",
},
# sanity tests do not need presence of sanity check or even tests
# folder
"sanity": {"args": ["--requirements"], "requires": ""},
"shell": {"args": ["--requirements"]},
"sanity": {"args": ["--requirements", "--venv"], "requires": ""},
"shell": {"args": ["--requirements", "--venv"]},
"units": {
"args": ["--requirements"],
"args": ["--requirements", "--venv"],
"requires": "tests/unit",
},
"windows-integration": {
"args": ["--requirements"],
"args": ["--requirements", "--venv"],
"requires": "tests/windows-integration",
},
# special commands (not supported by us yet)
Expand Down

0 comments on commit 9127a42

Please sign in to comment.