Initial ansible-test implementation. (#18556)

This commit is contained in:
Matt Clay 2016-11-29 21:21:53 -08:00 committed by GitHub
commit 6bbd92e422
191 changed files with 5483 additions and 48 deletions

12
test/utils/shippable/freebsd.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash -eux
set -o pipefail
declare -a args
IFS='/:' read -ra args <<< "${TEST}"
platform="${args[0]}"
version="${args[1]}"
target="posix/ci/"
ansible-test integration --color -v --retry-on-error "${target}" --remote "${platform}/${version}"

11
test/utils/shippable/linux.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash -eux
set -o pipefail
declare -a args
IFS='/:' read -ra args <<< "${TEST}"
image="ansible/ansible:${args[1]}"
target="posix/ci/group${args[2]}/"
ansible-test integration --color -v --retry-on-error "${target}" --docker "${image}"

12
test/utils/shippable/osx.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash -eux
set -o pipefail
declare -a args
IFS='/:' read -ra args <<< "${TEST}"
platform="${args[0]}"
version="${args[1]}"
target="posix/ci/"
ansible-test integration --color -v --retry-on-error "${target}" --remote "${platform}/${version}"

15
test/utils/shippable/other.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash -eux
set -o pipefail
add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty-backports universe'
add-apt-repository 'ppa:fkrull/deadsnakes'
apt-get update -qq
apt-get install python2.4 shellcheck -qq
pip install tox --disable-pip-version-check
ansible-test compile --color -v
ansible-test sanity --color -v --tox --skip-test ansible-doc --python 2.7
ansible-test sanity --color -v --tox --test ansible-doc --coverage

View file

@ -0,0 +1,40 @@
#!/bin/bash -eux
set -o pipefail
declare -a args
IFS='/:' read -ra args <<< "${TEST}"
script="${args[0]}"
docker images ansible/ansible
docker ps
if [ -d /home/shippable/cache/ ]; then
ls -la /home/shippable/cache/
fi
which python
python -V
which pip
pip --version
pip list --disable-pip-version-check
export PATH="test/runner:${PATH}"
reorganize-tests.sh # temporary solution until repositories are merged
function cleanup
{
if [ "$(ls test/results/coverage/)" ]; then
ansible-test coverage xml --color -v --requirements
cp -av test/results/reports/coverage.xml shippable/codecoverage/coverage.xml
fi
rmdir shippable/testresults/
cp -av test/results/junit/ shippable/testresults/
}
trap cleanup EXIT
"test/utils/shippable/${script}.sh"

5
test/utils/shippable/timing.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash -eux
set -o pipefail
"$1" 2>&1 | gawk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'

7
test/utils/shippable/units.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash -eux
set -o pipefail
pip install tox --disable-pip-version-check
ansible-test units --color -v --tox --coverage

38
test/utils/shippable/windows.sh Executable file
View file

@ -0,0 +1,38 @@
#!/bin/bash -eux
set -o pipefail
declare -a args
IFS='/:' read -ra args <<< "${TEST}"
job="${args[1]}"
ansible-test windows-integration --explain 2>&1 | grep ' windows-integration: .* (targeted)$' > /tmp/windows.txt
if [ -s /tmp/windows.txt ]; then
echo "Detected changes requiring integration tests specific to Windows:"
cat /tmp/windows.txt
if [ "${job}" != "1" ]; then
echo "Nothing to do, all Windows tests will run under TEST=windows/1 instead."
exit 0
fi
echo "Running Windows integration tests for multiple versions concurrently."
target="windows/ci/"
ansible-test windows-integration --color -v --retry-on-error "${target}" --requirements \
--windows 2008-SP2 \
--windows 2008-R2_SP1 \
--windows 2012-RTM \
--windows 2012-R2_RTM
else
echo "No changes requiring integration tests specific to Windows were detected."
echo "Running Windows integration tests for a single version only."
target="windows/ci/group${job}/"
ansible-test windows-integration --color -v --retry-on-error "${target}" --requirements \
--windows 2012-R2_RTM
fi