Browse Source

Add test_setup_skip role variable

This allows jobs which inherit from unittests to specify that
the test-setup script should not be run.  Some "unit test" jobs
are simple enough that they do not need to perform costly setup
for a full test run.

Change-Id: I5826bed411c42f9b3e0477b351bd82bd964d2fac
changes/19/670119/1
James E. Blair 4 months ago
parent
commit
9d8e765881
3 changed files with 9 additions and 2 deletions
  1. +6
    -0
      roles/test-setup/README.rst
  2. +1
    -1
      roles/test-setup/defaults/main.yaml
  3. +2
    -1
      roles/test-setup/tasks/main.yaml

+ 6
- 0
roles/test-setup/README.rst View File

@@ -20,6 +20,12 @@ automated testing system and developers.
String of optional command line options passed to
the test-setup script.

.. zuul:rolevar:: test_setup_skip
:default: false

Set this to true to skip running the test-setup script even if it
exists.

.. zuul:rolevar:: zuul_work_dir
:default: {{ zuul.project.src_dir }}


+ 1
- 1
roles/test-setup/defaults/main.yaml View File

@@ -1,6 +1,6 @@
---
test_setup_args: ""
test_setup_environment: {}
test_setup_skip: false

zuul_work_dir: "src/{{ zuul.project.canonical_name }}"


+ 2
- 1
roles/test-setup/tasks/main.yaml View File

@@ -1,4 +1,4 @@
- name: Check if project's tools/test-setup.sh exists
- name: "Check if project's tools/test-setup.sh exists"
stat:
path: "{{ zuul_work_dir }}/tools/test-setup.sh"
register: p
@@ -11,3 +11,4 @@
when:
- p.stat.exists
- p.stat.executable
- not test_setup_skip

Loading…
Cancel
Save