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 9 months 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 @@
1
+---
2
+- job:
3
+    name: ansible-role-zookeeper
4
+    run: tests/playbooks/run.yaml
5
+    roles:
6
+      - zuul: openstack/ansible-role-zookeeper
7
+
8
+- job:
9
+    name: ansible-role-zookeeper-fedora-latest
10
+    parent: ansible-role-zookeeper
11
+    nodeset: fedora-latest
12
+
13
+- job:
14
+    name: ansible-role-zookeeper-ubuntu-bionic
15
+    parent: ansible-role-zookeeper
16
+    nodeset: ubuntu-bionic
17
+
18
+- job:
19
+    name: ansible-role-zookeeper-ubuntu-xenial
20
+    parent: ansible-role-zookeeper
21
+    nodeset: ubuntu-xenial
22
+
23
+- project:
24
+    templates:
25
+      - windmill-jobs-fedora-latest
26
+      - windmill-jobs-bionic
27
+      - windmill-jobs-xenial
28
+    check:
29
+      jobs:
30
+        - ansible-role-zookeeper-fedora-latest
31
+        - ansible-role-zookeeper-ubuntu-bionic
32
+        - ansible-role-zookeeper-ubuntu-xenial
33
+        - tox-linters
34
+    gate:
35
+      jobs:
36
+        - ansible-role-zookeeper-fedora-latest
37
+        - ansible-role-zookeeper-ubuntu-bionic
38
+        - ansible-role-zookeeper-ubuntu-xenial
39
+        - tox-linters

+ 0
- 2
tests/ansible.cfg View File

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

+ 0
- 1
tests/inventory View File

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

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

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

+ 4
- 14
tox.ini View File

@@ -4,20 +4,10 @@ envlist = docs,linters
4 4
 skipsdist = True
5 5
 
6 6
 [testenv]
7
+basepython = python3
7 8
 deps = -r{toxinidir}/requirements.txt
8 9
        -r{toxinidir}/test-requirements.txt
9 10
 
10
-[testenv:functional]
11
-commands =
12
-  # NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
13
-  ansible-playbook -i tests/inventory tests/test.yaml -e ansible_user={env:USER}
14
-passenv =
15
-  HOME
16
-  USER
17
-setenv =
18
-  ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
19
-  PYTHONUNBUFFERED = 1
20
-
21 11
 [testenv:docs]
22 12
 commands = python setup.py build_sphinx
23 13
 
@@ -34,14 +24,14 @@ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
34 24
 
35 25
 [testenv:linters]
36 26
 setenv =
37
-  ANSIBLE_CONFIG = tests/ansible.cfg
27
+  ANSIBLE_ROLES_PATH = ..
38 28
 whitelist_externals = bash
39 29
 commands =
40 30
   # PEP8 Lint Check
41 31
   flake8
42 32
   # Ansible Lint Check
43
-  bash -c "find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
44
-    ansible-lint"
33
+  bash -c "find . -not -path '*/\.*' -type f -regex '.*.y[a]?ml' -print0 | \
34
+    xargs -t -n1 -0 ansible-lint"
45 35
   # Ansible Syntax Check
46 36
   bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
47 37
     ansible-playbook --syntax-check -i tests/inventory \

Loading…
Cancel
Save