Add windmill-tox-ubuntu-xenial

This refactors the existing windmill-tox-deploy job. We are basically
removing a lot of the logic from tox -edeploy and just using the venv
environment from tox.  It is very much possible we may remove the
dependency on tox in the future.

Change-Id: I29a1b06c4e02e3c5f588135042f77ccc4a031a7d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-04-09 17:34:34 -04:00
parent 0c6650d157
commit 0a1b5f5834
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
7 changed files with 41 additions and 27 deletions

View File

@ -1,7 +1,7 @@
- job:
name: windmill-tox-deploy
parent: tox
run: tests/playbooks/tox/run.yaml
name: windmill-tox-ubuntu-xenial
pre-run: tests/playbooks/pre.yaml
run: tests/playbooks/run.yaml
nodeset: ubuntu-xenial
required-projects:
- openstack/ansible-role-diskimage-builder
@ -15,6 +15,3 @@
- openstack/ansible-role-virtualenv
- openstack/ansible-role-zookeeper
- openstack/ansible-role-zuul
vars:
tox_envlist: deploy
tox_extra_args: '-vv -- --extra-vars "@tests/extra-vars.yaml"'

View File

@ -6,7 +6,7 @@
- windmill-jobs-xenial
check:
jobs:
- windmill-tox-deploy
- windmill-tox-ubuntu-xenial
gate:
jobs:
- windmill-tox-deploy
- windmill-tox-ubuntu-xenial

18
tests/playbooks/pre.yaml Normal file
View File

@ -0,0 +1,18 @@
- hosts: all
tasks:
- name: Bootstrap tox environment
args:
chdir: "{{ zuul.project.src_dir }}"
command: tox -evenv --notest
- name: Install bindep dependendies
args:
chdir: "{{ zuul.project.src_dir }}"
executable: /bin/bash
shell: source .tox/venv/bin/activate; ./tools/install_bindep.sh
- name: Install ansible roles via galaxy
args:
chdir: "{{ zuul.project.src_dir }}"
executable: /bin/bash
shell: source .tox/venv/bin/activate; ./tools/install_roles.sh

11
tests/playbooks/run.yaml Normal file
View File

@ -0,0 +1,11 @@
- hosts: all
tasks:
- name: Bootstrap bastion node using ansible
args:
chdir: "{{ zuul.project.src_dir }}"
shell: tox -evenv -- ansible-playbook -i inventory/single-node playbooks/bastion.yaml
- name: Run ansible-playbook
args:
chdir: "{{ zuul.project.src_dir }}"
shell: tox -evenv -- ansible-playbook -i inventory/single-node playbooks/site.yaml --extra-vars "@tests/extra-vars.yaml"

View File

@ -1,3 +0,0 @@
- hosts: all
roles:
- tox

23
tox.ini
View File

@ -15,22 +15,6 @@ deps = -r{toxinidir}/requirements.txt
deps = bindep
commands = bindep test
[testenv:deploy]
deps = -r{toxinidir}/requirements.txt
commands =
{toxinidir}/tools/install_bindep.sh
{toxinidir}/tools/install_roles.sh
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
ansible-playbook -i inventory/single-node playbooks/bastion.yaml {posargs}
ansible-playbook -i inventory/single-node playbooks/site.yaml {posargs}
passenv =
HOME
SSH_AUTH_SOCK
USER
setenv =
ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
PYTHONUNBUFFERED = 1
[testenv:docs]
commands = python setup.py build_sphinx
@ -43,6 +27,13 @@ commands =
[testenv:venv]
commands = {posargs}
passenv =
HOME
SSH_AUTH_SOCK
USER
setenv =
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
PYTHONUNBUFFERED = 1
[flake8]
# E123, E125 skipped as they are invalid PEP-8.