Merge "Add an ensure-tox test job"
This commit is contained in:
commit
b01f3f8c4c
63
test-playbooks/ensure-tox.yaml
Normal file
63
test-playbooks/ensure-tox.yaml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
- hosts: all
|
||||||
|
name: Test ensure-tox when tox is installed in system default
|
||||||
|
tasks:
|
||||||
|
- name: Verify tox is pre-installed on OpenDev images
|
||||||
|
command: "tox --version"
|
||||||
|
- name: Run ensure-tox with tox already installed
|
||||||
|
include_role:
|
||||||
|
name: ensure-tox
|
||||||
|
- name: Verify tox_executable is not set by ensure-tox
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- tox_executable is not defined
|
||||||
|
|
||||||
|
- hosts: all
|
||||||
|
name: Test ensure-tox when tox_executable is already set and tox is installed
|
||||||
|
tasks:
|
||||||
|
- name: Run ensure-tox with tox not installed
|
||||||
|
include_role:
|
||||||
|
name: ensure-tox
|
||||||
|
vars:
|
||||||
|
tox_executable: "python3 -m tox"
|
||||||
|
- name: Verify tox_executable is not set by ensure-tox
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- tox_executable is not defined
|
||||||
|
|
||||||
|
- hosts: all
|
||||||
|
name: Remove pre-installed tox
|
||||||
|
tasks:
|
||||||
|
- name: Remove tox package with pip
|
||||||
|
shell: pip uninstall -y tox
|
||||||
|
become: true
|
||||||
|
ignore_errors: true
|
||||||
|
- name: Remove tox package with pip3
|
||||||
|
shell: pip3 uninstall -y tox
|
||||||
|
become: true
|
||||||
|
ignore_errors: true
|
||||||
|
- name: Verify tox is not installed
|
||||||
|
command: "tox --version"
|
||||||
|
register: result
|
||||||
|
failed_when: result.rc == 0
|
||||||
|
|
||||||
|
- hosts: all
|
||||||
|
name: Test ensure-tox when tox is not installed
|
||||||
|
tasks:
|
||||||
|
- name: Remove tox package
|
||||||
|
shell: pip uninstall tox || pip3 uninstall tox
|
||||||
|
become: true
|
||||||
|
- name: Verify tox is not installed
|
||||||
|
command: "tox --version"
|
||||||
|
register: result
|
||||||
|
failed_when: result.rc == 0
|
||||||
|
- name: Run ensure-tox with tox not installed
|
||||||
|
include_role:
|
||||||
|
name: ensure-tox
|
||||||
|
- name: Verify tox_executable is set
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- tox_executable == "{{ ansible_user_dir }}/.local/bin/tox"
|
||||||
|
- name: Verify tox is installed
|
||||||
|
command: "{{ tox_executable }} --version"
|
||||||
|
register: result
|
||||||
|
failed_when: result.rc != 0
|
@ -7,6 +7,13 @@
|
|||||||
vars:
|
vars:
|
||||||
role_name: ensure-sphinx
|
role_name: ensure-sphinx
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: zuul-jobs-test-ensure-tox
|
||||||
|
description: Test the ensure-tox role
|
||||||
|
files:
|
||||||
|
- roles/ensure-tox/.*
|
||||||
|
run: test-playbooks/ensure-tox.yaml
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: zuul-jobs-test-tox-siblings
|
name: zuul-jobs-test-tox-siblings
|
||||||
description: Test the tox role's sibling functionality
|
description: Test the tox role's sibling functionality
|
||||||
@ -46,6 +53,7 @@
|
|||||||
check:
|
check:
|
||||||
jobs: &id001
|
jobs: &id001
|
||||||
- zuul-jobs-test-ensure-sphinx
|
- zuul-jobs-test-ensure-sphinx
|
||||||
|
- zuul-jobs-test-ensure-tox
|
||||||
- zuul-jobs-test-tox-siblings
|
- zuul-jobs-test-tox-siblings
|
||||||
- zuul-jobs-test-fetch-tox-output
|
- zuul-jobs-test-fetch-tox-output
|
||||||
- zuul-jobs-test-fetch-tox-output-synchronize
|
- zuul-jobs-test-fetch-tox-output-synchronize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user