diff --git a/molecule-requirements.txt b/molecule-requirements.txt index 6c0cb63..26c4f50 100644 --- a/molecule-requirements.txt +++ b/molecule-requirements.txt @@ -1,2 +1,3 @@ +ansible docker molecule>=3.0,<3.1 diff --git a/scripts/run-local-test b/scripts/run-local-test index a804b06..f584369 100644 --- a/scripts/run-local-test +++ b/scripts/run-local-test @@ -20,6 +20,19 @@ set -xeo export ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles" export PROJECT_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))/../" +export UPPER_CONSTRAINTS_FILE=${UPPER_CONSTRAINTS_FILE:-"https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt"} + +function run_pip { + "${HOME}/test-python/bin/pip" install \ + -c "${UPPER_CONSTRAINTS_FILE}" \ + -r "${PROJECT_DIR}/molecule-requirements.txt" ${@:-} +} + +# Create a virtual environment and install dependencies +PYTHON_EXEC=$(command -v python3 || command -v python) +"${PYTHON_EXEC}" -m virtualenv --system-site-packages "${HOME}/test-python" +run_pip + ansible-playbook -i "${PROJECT_DIR}/tests/hosts.ini" \ -e "tripleo_src=$(realpath --relative-to="${HOME}" "${PROJECT_DIR}")" \