Install ARA with zuul-cloner if we're running inside the ARA gate
This commit mutually benefits both OSA and ARA: it allows ARA to leverage the func jobs of OSA as a mean to test itself in it's own gate and make sure one of it's patches does not break OSA. It also moves the ARA callback setup from env-prep to functional which is the only place where it makes sense to set up ARA in the first place. Change-Id: Ia7b46424740da94b82c57b828b53c7993fdaa76b
This commit is contained in:
parent
dc6c990134
commit
c928b5774a
@ -13,6 +13,3 @@ git+git://github.com/ansible/ansible.git@e85f3f44610fa454c80da6b0f5ae84e3887a695
|
|||||||
|
|
||||||
# The Ansible lint version used for lint tests
|
# The Ansible lint version used for lint tests
|
||||||
ansible-lint==3.4.1
|
ansible-lint==3.4.1
|
||||||
|
|
||||||
# ARA for reporting
|
|
||||||
ara
|
|
||||||
|
@ -95,15 +95,6 @@ else
|
|||||||
echo "Skipping the role link because no role name was provided."
|
echo "Skipping the role link because no role name was provided."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Link the ARA Callback directory to the the ansible callback directory
|
|
||||||
if [ -d "${WORKING_DIR}/.tox/functional/lib/python2.7/site-packages/ara/plugins/callbacks" ]; then
|
|
||||||
if [ ! -L "${ANSIBLE_PLUGIN_DIR}/callback/ara" ]; then
|
|
||||||
echo "Linking ${ANSIBLE_PLUGIN_DIR}/callback/ara to ${WORKING_DIR}/.tox/functional/lib/python2.7/site-packages/ara/plugins/callbacks/"
|
|
||||||
mkdir -p "${ANSIBLE_PLUGIN_DIR}/callback/ara"
|
|
||||||
ln -sf "${WORKING_DIR}/.tox/functional/lib/python2.7/site-packages/ara/plugins/callbacks" "${ANSIBLE_PLUGIN_DIR}/callback/ara/"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure that the Ansible configuration file is in the right place
|
# Ensure that the Ansible configuration file is in the right place
|
||||||
if [ ! -f "${ANSIBLE_CFG_PATH}" ]; then
|
if [ ! -f "${ANSIBLE_CFG_PATH}" ]; then
|
||||||
if [ -f "${COMMON_TESTS_PATH}/test-ansible.cfg" ]; then
|
if [ -f "${COMMON_TESTS_PATH}/test-ansible.cfg" ]; then
|
||||||
|
@ -60,6 +60,29 @@ function set_ansible_parameters {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setup_ara {
|
||||||
|
|
||||||
|
# Don't do anything if ARA has already been set up
|
||||||
|
[[ -L "${ANSIBLE_PLUGIN_DIR}/callback/ara" ]] && return 0
|
||||||
|
|
||||||
|
# Install ARA from source if running in ARA gate, otherwise install from PyPi
|
||||||
|
if [[ -e /usr/zuul-env/bin/zuul-cloner && "${ZUUL_PROJECT}" == "openstack/ara" ]]; then
|
||||||
|
/usr/zuul-env/bin/zuul-cloner --workspace /tmp --cache-dir /opt/git \
|
||||||
|
git://git.openstack.org openstack/ara
|
||||||
|
${WORKING_DIR}/.tox/functional/bin/pip install /tmp/openstack/ara
|
||||||
|
else
|
||||||
|
${WORKING_DIR}/.tox/functional/bin/pip install ara
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Dynamically figure out the location of ARA (ex: py2 vs py3)
|
||||||
|
ara_location=$(${WORKING_DIR}/.tox/functional/bin/python -c "import os,ara; print(os.path.dirname(ara.__file__))")
|
||||||
|
|
||||||
|
echo "Linking ${ANSIBLE_PLUGIN_DIR}/callback/ara to ${ara_location}/plugins/callbacks/"
|
||||||
|
mkdir -p "${ANSIBLE_PLUGIN_DIR}/callback/ara"
|
||||||
|
ln -sf "${ara_location}/plugins/callbacks" "${ANSIBLE_PLUGIN_DIR}/callback/ara/"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function execute_ansible_playbook {
|
function execute_ansible_playbook {
|
||||||
|
|
||||||
CMD_TO_EXECUTE="ansible-playbook ${TEST_PLAYBOOK} $@ ${ANSIBLE_CLI_PARAMETERS}"
|
CMD_TO_EXECUTE="ansible-playbook ${TEST_PLAYBOOK} $@ ${ANSIBLE_CLI_PARAMETERS}"
|
||||||
@ -90,6 +113,7 @@ fi
|
|||||||
|
|
||||||
# Ensure that the Ansible environment is properly prepared
|
# Ensure that the Ansible environment is properly prepared
|
||||||
source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
|
source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
|
||||||
|
setup_ara
|
||||||
|
|
||||||
# Set gate job exit traps, this is run regardless of exit state when the job finishes.
|
# Set gate job exit traps, this is run regardless of exit state when the job finishes.
|
||||||
trap gate_job_exit_tasks EXIT
|
trap gate_job_exit_tasks EXIT
|
||||||
|
Loading…
Reference in New Issue
Block a user