Move ansible installation from pre_command to install phase in tox

We currently install ansible during the pre_command phase in tox. This
breaks the following use case:

  tox -e py36 --notest
  ttrun <test case>

This is broken now because ttrun doesn't run pre_commands. Instead we
already have a pip wrapper that does the nodeenv installation. We can
use this to also call zuul-manage-ansible on zuul installation.

Change-Id: I680777e5406368d35366602ac37e029db91c8a5c
This commit is contained in:
Tobias Henkel 2019-03-19 08:26:02 +01:00
parent 0f8f24e7df
commit fa0715eeac
No known key found for this signature in database
GPG Key ID: 03750DEC158E5FA2
2 changed files with 5 additions and 2 deletions

View File

@ -38,3 +38,8 @@ then
popd
fi
pip install $*
# Check if we're installing zuul. If so install the managed ansible as well.
if echo "$*" | grep -vq requirements.txt; then
zuul-manage-ansible -v
fi

View File

@ -25,7 +25,6 @@ install_command = pip install {opts} {packages}
whitelist_externals = bash
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands_pre = zuul-manage-ansible -v
commands = stestr run {posargs}
stestr slowest
@ -82,7 +81,6 @@ install_command = {[nodeenv]install_command}
commands = stestr run --concurrency=1 --test-path ./tests/nodepool {posargs}
[testenv:remote]
commands_pre = zuul-manage-ansible -v
commands = stestr run --test-path ./tests/remote {posargs}
passenv = ZUUL_TEST_ROOT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_LOG_DEFAULTS ZUUL_REMOTE_IPV4 ZUUL_SSH_KEY NODEPOOL_ZK_HOST
install_command = {[nodeenv]install_command}