tests: paralellize vanilla Ansible run.

This commit is contained in:
David Wilson 2018-05-06 09:19:01 +01:00
parent 60781ecab6
commit c00e7ed367
4 changed files with 20 additions and 23 deletions

View File

@ -10,13 +10,16 @@ python:
- "2.7" - "2.7"
env: env:
- MODE=mitogen MITOGEN_TEST_DISTRO=debian - MODE=mitogen DISTRO=debian
- MODE=mitogen MITOGEN_TEST_DISTRO=centos - MODE=mitogen DISTRO=centos
- MODE=debops_common ANSIBLE_VERSION=2.4.3.0 - MODE=debops_common VER=2.4.3.0
- MODE=debops_common ANSIBLE_VERSION=2.5.1 - MODE=debops_common VER=2.5.1
- MODE=ansible ANSIBLE_VERSION=2.4.3.0 MITOGEN_TEST_DISTRO=debian # Ansible tests.
- MODE=ansible ANSIBLE_VERSION=2.5.1 MITOGEN_TEST_DISTRO=centos - MODE=ansible VER=2.4.3.0 DISTRO=debian
- MODE=ansible ANSIBLE_VERSION=2.5.1 MITOGEN_TEST_DISTRO=debian - MODE=ansible VER=2.5.1 DISTRO=centos
- MODE=ansible VER=2.5.1 DISTRO=debian
# Sanity check our tests against vanilla Ansible, they should still pass.
- MODE=ansible VER=2.5.1 DISTRO=debian STRATEGY=linear
install: install:
- pip install -r dev_requirements.txt - pip install -r dev_requirements.txt

View File

@ -3,8 +3,9 @@
TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-`pwd`}" TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-`pwd`}"
TMPDIR="/tmp/ansible-tests-$$" TMPDIR="/tmp/ansible-tests-$$"
ANSIBLE_VERSION="${ANSIBLE_VERSION:-2.4.3.0}" ANSIBLE_VERSION="${VER:-2.4.3.0}"
MITOGEN_TEST_DISTRO="${MITOGEN_TEST_DISTRO:-debian}" export ANSIBLE_STRATEGY="${STRATEGY:-mitogen_linear}"
DISTRO="${DISTRO:-debian}"
export PYTHONPATH="${PYTHONPATH}:${TRAVIS_BUILD_DIR}" export PYTHONPATH="${PYTHONPATH}:${TRAVIS_BUILD_DIR}"
@ -30,7 +31,7 @@ docker run \
--detach \ --detach \
--publish 0.0.0.0:2201:22/tcp \ --publish 0.0.0.0:2201:22/tcp \
--name=target \ --name=target \
mitogen/${MITOGEN_TEST_DISTRO}-test mitogen/${DISTRO}-test
echo travis_fold:end:docker_setup echo travis_fold:end:docker_setup
@ -57,15 +58,8 @@ make -C ${TRAVIS_BUILD_DIR}/tests/ansible
echo travis_fold:end:job_setup echo travis_fold:end:job_setup
echo travis_fold:start:mitogen_linear echo travis_fold:start:ansible
/usr/bin/time ./mitogen_ansible_playbook.sh \
all.yml \
-i "${TMPDIR}/hosts"
echo travis_fold:end:mitogen_linear
echo travis_fold:start:vanilla_ansible
/usr/bin/time ./run_ansible_playbook.sh \ /usr/bin/time ./run_ansible_playbook.sh \
all.yml \ all.yml \
-i "${TMPDIR}/hosts" -i "${TMPDIR}/hosts"
echo travis_fold:end:vanilla_ansible echo travis_fold:end:ansible

View File

@ -4,8 +4,8 @@
TMPDIR="/tmp/debops-$$" TMPDIR="/tmp/debops-$$"
TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-`pwd`}" TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-`pwd`}"
TARGET_COUNT="${TARGET_COUNT:-2}" TARGET_COUNT="${TARGET_COUNT:-2}"
ANSIBLE_VERSION="${ANSIBLE_VERSION:-2.4.3.0}" ANSIBLE_VERSION="${VER:-2.4.3.0}"
MITOGEN_TEST_DISTRO=debian # Naturally DebOps only supports Debian. DISTRO=debian # Naturally DebOps only supports Debian.
export PYTHONPATH="${PYTHONPATH}:${TRAVIS_BUILD_DIR}" export PYTHONPATH="${PYTHONPATH}:${TRAVIS_BUILD_DIR}"
@ -60,7 +60,7 @@ do
--detach \ --detach \
--publish 0.0.0.0:$port:22/tcp \ --publish 0.0.0.0:$port:22/tcp \
--name=target$i \ --name=target$i \
mitogen/${MITOGEN_TEST_DISTRO}-test mitogen/${DISTRO}-test
echo \ echo \
target$i \ target$i \

View File

@ -1,5 +1,5 @@
#!/bin/bash -ex #!/bin/bash -ex
# Run the Mitogen tests. # Run the Mitogen tests.
MITOGEN_TEST_DISTRO="${MITOGEN_TEST_DISTRO:-debian}" MITOGEN_TEST_DISTRO="${DISTRO:-debian}"
MITOGEN_LOG_LEVEL=debug PYTHONPATH=. ${TRAVIS_BUILD_DIR}/run_tests MITOGEN_LOG_LEVEL=debug PYTHONPATH=. ${TRAVIS_BUILD_DIR}/run_tests