Add extra-test-setup role
Change-Id: Icad9896e524c69e92e9ceabd86c6ca28360887fa Co-Authored-By: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
Roles
|
Roles
|
||||||
=====
|
=====
|
||||||
|
|
||||||
|
extra-test-setup
|
||||||
|
----------------
|
||||||
|
.. include:: ../../roles/extra-test-setup/README.rst
|
||||||
|
|
||||||
revoke-sudo
|
revoke-sudo
|
||||||
-----------
|
-----------
|
||||||
.. include:: ../../roles/revoke-sudo/README.rst
|
.. include:: ../../roles/revoke-sudo/README.rst
|
||||||
|
|||||||
10
roles/extra-test-setup/README.rst
Normal file
10
roles/extra-test-setup/README.rst
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
Perform project test setup tasks.
|
||||||
|
|
||||||
|
This role assumes that Zuul has checked out a change for a project at
|
||||||
|
``{{ zuul_workspace_root }}/src/{{ zuul.project.canonical_name }}``
|
||||||
|
and looks for a file named ``tools/test-setup.sh``. If that file
|
||||||
|
exists and is executable, it will be run.
|
||||||
|
|
||||||
|
This allows projects to specify test-setup steps (such as creating or
|
||||||
|
initializing a database) in a form that can be easily run by both an
|
||||||
|
automated testing system and developers.
|
||||||
12
roles/extra-test-setup/tasks/main.yaml
Normal file
12
roles/extra-test-setup/tasks/main.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
- name: Check if projects tools/test-setup.sh exists.
|
||||||
|
stat:
|
||||||
|
path: "{{ zuul_workspace_root }}/src/{{ zuul.project.canonical_name }}/tools/test-setup.sh"
|
||||||
|
register: p
|
||||||
|
|
||||||
|
- name: Run tools/test-setup.sh.
|
||||||
|
shell: tools/test-setup.sh
|
||||||
|
args:
|
||||||
|
chdir: "{{ zuul_workspace_root }}/src/{{ zuul.project.canonical_name }}"
|
||||||
|
when:
|
||||||
|
- p.stat.exists
|
||||||
|
- p.stat.executable
|
||||||
Reference in New Issue
Block a user