Allow run_tests to run integration tests against any ansible version
Also some minor improvements around cleanup and where test logs and build go. Change-Id: I600598545b7308e74531e13fddf3930e35d19dda
This commit is contained in:
parent
562bff53ec
commit
e90adfa9fa
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,3 +14,4 @@ eggs
|
|||||||
.coverage
|
.coverage
|
||||||
*.retry
|
*.retry
|
||||||
cover/
|
cover/
|
||||||
|
*.tmp
|
||||||
|
17
run_tests.sh
17
run_tests.sh
@ -8,13 +8,22 @@ BUILD_DIR="${LOGDIR}/build"
|
|||||||
export ANSIBLE_TMP_DIR="${LOGDIR}/ansible"
|
export ANSIBLE_TMP_DIR="${LOGDIR}/ansible"
|
||||||
DATABASE="${LOGDIR}/ansible.sqlite"
|
DATABASE="${LOGDIR}/ansible.sqlite"
|
||||||
|
|
||||||
# Cleanup any previous runs
|
# Cleanup from any previous runs if necessary
|
||||||
rm -rf $LOGDIR
|
git checkout requirements.txt
|
||||||
mkdir -p $LOGDIR
|
[[ -e "${LOGDIR}" ]] && rm -rf "${LOGDIR}"
|
||||||
|
[[ -e ".tox/venv" ]] && rm -rf .tox/venv
|
||||||
|
mkdir -p "${LOGDIR}"
|
||||||
|
|
||||||
|
# We might want to test with a particular version of Ansible
|
||||||
|
# To specify a version, use "./run_tests.sh ansible==2.x.x.x"
|
||||||
|
if [ -n "${1}" ]; then
|
||||||
|
sed -i.tmp -e "s/ansible.*/${1}/" requirements.txt
|
||||||
|
fi
|
||||||
|
|
||||||
# Install ARA so it can be used from a virtual environment
|
# Install ARA so it can be used from a virtual environment
|
||||||
tox -e venv --notest
|
tox -e venv --notest
|
||||||
source .tox/venv/bin/activate
|
source .tox/venv/bin/activate
|
||||||
|
ansible --version
|
||||||
|
|
||||||
# Setup ARA
|
# Setup ARA
|
||||||
export ANSIBLE_CALLBACK_PLUGINS="ara/plugins/callbacks"
|
export ANSIBLE_CALLBACK_PLUGINS="ara/plugins/callbacks"
|
||||||
@ -38,3 +47,5 @@ ara task show $(ara task list -a -c ID -f value |head -n1)
|
|||||||
ara file list -b $pbid
|
ara file list -b $pbid
|
||||||
ara file show $(ara file list -b $pbid -c ID -f value|head -n1)
|
ara file show $(ara file list -b $pbid -c ID -f value|head -n1)
|
||||||
ara generate ${BUILD_DIR} && tree ${BUILD_DIR}
|
ara generate ${BUILD_DIR} && tree ${BUILD_DIR}
|
||||||
|
|
||||||
|
echo "Run complete, logs and build available in ${LOGDIR}"
|
Loading…
Reference in New Issue
Block a user