Browse Source

Add .zuul.yaml file

Add windmill testing in-tree, to confirm we don't break windmill.

Change-Id: I0f9c7eb5a758c18668674411bd91312a078c056e
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/91/621691/4
Paul Belanger 1 year ago
parent
commit
ffdd8bf866
5 changed files with 46 additions and 27 deletions
  1. +39
    -0
      .zuul.yaml
  2. +0
    -2
      tests/ansible.cfg
  3. +0
    -1
      tests/inventory
  4. +3
    -10
      tests/playbooks/run.yaml
  5. +4
    -14
      tox.ini

+ 39
- 0
.zuul.yaml View File

@@ -0,0 +1,39 @@
---
- job:
name: ansible-role-zookeeper
run: tests/playbooks/run.yaml
roles:
- zuul: openstack/ansible-role-zookeeper

- job:
name: ansible-role-zookeeper-fedora-latest
parent: ansible-role-zookeeper
nodeset: fedora-latest

- job:
name: ansible-role-zookeeper-ubuntu-bionic
parent: ansible-role-zookeeper
nodeset: ubuntu-bionic

- job:
name: ansible-role-zookeeper-ubuntu-xenial
parent: ansible-role-zookeeper
nodeset: ubuntu-xenial

- project:
templates:
- windmill-jobs-fedora-latest
- windmill-jobs-bionic
- windmill-jobs-xenial
check:
jobs:
- ansible-role-zookeeper-fedora-latest
- ansible-role-zookeeper-ubuntu-bionic
- ansible-role-zookeeper-ubuntu-xenial
- tox-linters
gate:
jobs:
- ansible-role-zookeeper-fedora-latest
- ansible-role-zookeeper-ubuntu-bionic
- ansible-role-zookeeper-ubuntu-xenial
- tox-linters

+ 0
- 2
tests/ansible.cfg View File

@@ -1,2 +0,0 @@
[defaults]
roles_path = ../..

+ 0
- 1
tests/inventory View File

@@ -1,2 +1 @@
[all]
localhost

tests/test.yaml → tests/playbooks/run.yaml View File

@@ -1,4 +1,4 @@
# Copyright 2015 Red Hat, Inc.
# Copyright 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -12,16 +12,9 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- hosts: localhost
- hosts: all
vars:
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
pre_tasks:
# Make sure OS does not have a stale package cache.
- name: Update apt cache.
become: yes
apt:
update_cache: yes
when: ansible_os_family == 'Debian'
rolename: ansible-role-zookeeper

roles:
- "{{ rolename }}"

+ 4
- 14
tox.ini View File

@@ -4,20 +4,10 @@ envlist = docs,linters
skipsdist = True

[testenv]
basepython = python3
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt

[testenv:functional]
commands =
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
ansible-playbook -i tests/inventory tests/test.yaml -e ansible_user={env:USER}
passenv =
HOME
USER
setenv =
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
PYTHONUNBUFFERED = 1

[testenv:docs]
commands = python setup.py build_sphinx

@@ -34,14 +24,14 @@ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

[testenv:linters]
setenv =
ANSIBLE_CONFIG = tests/ansible.cfg
ANSIBLE_ROLES_PATH = ..
whitelist_externals = bash
commands =
# PEP8 Lint Check
flake8
# Ansible Lint Check
bash -c "find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
ansible-lint"
bash -c "find . -not -path '*/\.*' -type f -regex '.*.y[a]?ml' -print0 | \
xargs -t -n1 -0 ansible-lint"
# Ansible Syntax Check
bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
ansible-playbook --syntax-check -i tests/inventory \

Loading…
Cancel
Save