Fix tests which assume virtualenv is available.

This commit is contained in:
Matt Clay 2019-03-27 02:42:11 -07:00
parent 62d3ed0e2f
commit 8612b126a8
6 changed files with 16 additions and 27 deletions

View file

@ -1,10 +1,9 @@
#!/usr/bin/env bash
set -ex
virtualenv --system-site-packages --python "${ANSIBLE_TEST_PYTHON_INTERPRETER}" "${OUTPUT_DIR}/venv"
source "${OUTPUT_DIR}/venv/bin/activate"
set -eux
source virtualenv.sh
# Requirements have to be installed prior to running ansible-playbook
# because plugins and requirements are loaded before the task runs

View file

@ -1,15 +1,8 @@
#!/usr/bin/env bash
# We don't set -u here, due to pypa/virtualenv#150
set -ex
set -eux
MYTMPDIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
trap 'rm -rf "${MYTMPDIR}"' EXIT
virtualenv --system-site-packages --python "${ANSIBLE_TEST_PYTHON_INTERPRETER}" "${MYTMPDIR}/jinja2"
source "${MYTMPDIR}/jinja2/bin/activate"
source virtualenv.sh
pip install -U jinja2==2.9.4

View file

@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -ex
set -eux
source virtualenv.sh
virtualenv --system-site-packages --python "${ANSIBLE_TEST_PYTHON_INTERPRETER:-python}" "${OUTPUT_DIR}/aws-ec2-inventory"
source "${OUTPUT_DIR}/aws-ec2-inventory/bin/activate"
pip install "python-dateutil>=2.1,<2.7.0" jmespath "Jinja2>=2.10" PyYaml cryptography paramiko
# create boto3 symlinks

View file

@ -1,10 +1,9 @@
#!/usr/bin/env bash
set -ex
virtualenv --system-site-packages --python "${ANSIBLE_TEST_PYTHON_INTERPRETER}" "${OUTPUT_DIR}/venv"
source "${OUTPUT_DIR}/venv/bin/activate"
set -eux
source virtualenv.sh
# Requirements have to be installed prior to running ansible-playbook
# because plugins and requirements are loaded before the task runs
pip install passlib

View file

@ -1,15 +1,8 @@
#!/usr/bin/env bash
# We don't set -u here, due to pypa/virtualenv#150
set -ex
set -eux
MYTMPDIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
trap 'rm -rf "${MYTMPDIR}"' EXIT
virtualenv --system-site-packages --python "${ANSIBLE_TEST_PYTHON_INTERPRETER}" "${MYTMPDIR}/jinja2"
source "${MYTMPDIR}/jinja2/bin/activate"
source virtualenv.sh
pip install -U jinja2

View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Create and activate a fresh virtual environment with `source virtualenv.sh`.
rm -rf "${OUTPUT_DIR}/venv"
"${ANSIBLE_TEST_PYTHON_INTERPRETER}" -m virtualenv --system-site-packages --python "${ANSIBLE_TEST_PYTHON_INTERPRETER}" "${OUTPUT_DIR}/venv"