Integration tests: differentiate labels for different pipelines

zuul.change isn't available in the post and periodic pipelines so we
shouldn't try to include it.

We're splitting this into a different file so we can add more things
later.

Change-Id: I53a257aafba395e07afc0a1755e26cab28c1b2f0
This commit is contained in:
David Moreau Simard 2020-01-29 13:12:37 -05:00
parent ad8803318f
commit c5df7f2cd6
No known key found for this signature in database
GPG Key ID: 938880DAFC753E80
3 changed files with 28 additions and 16 deletions

View File

@ -89,14 +89,8 @@
command: "{{ ara_api_venv_path }}/bin/python -m ara.setup.plugins"
register: ara_setup_plugins
- name: Set default labels with Zuul
set_fact:
_default_labels:
- "nodepool.provider:{{ nodepool.provider }}"
- "zuul.change:{{ zuul.change }}"
- "zuul.executor:{{ zuul.executor.hostname }}"
- "zuul.pipeline:{{ zuul.pipeline }}"
- "zuul.project:{{ zuul.project.canonical_name }}"
- name: Record Zuul metadata for ARA playbooks
include_tasks: zuul_metadata.yaml
when: zuul is defined
- name: Template an ansible.cfg file

View File

@ -63,14 +63,8 @@
changed_when: false
register: ara_setup_plugins
- name: Set default labels with Zuul
set_fact:
_default_labels:
- "nodepool.provider:{{ nodepool.provider }}"
- "zuul.change:{{ zuul.change }}"
- "zuul.executor:{{ zuul.executor.hostname }}"
- "zuul.pipeline:{{ zuul.pipeline }}"
- "zuul.project:{{ zuul.project.canonical_name }}"
- name: Record Zuul metadata for ARA playbooks
include_tasks: zuul_metadata.yaml
when: zuul is defined
# These aren't in the same task (i.e, with loop) so we can tell individual test

24
tests/zuul_metadata.yaml Normal file
View File

@ -0,0 +1,24 @@
- name: Set default labels for check, gate and promote pipelines
set_fact:
_default_labels:
- "nodepool.provider:{{ nodepool.provider }}"
- "zuul.change:{{ zuul.change }}"
- "zuul.executor:{{ zuul.executor.hostname }}"
- "zuul.job:{{ zuul.job }}"
- "zuul.pipeline:{{ zuul.pipeline }}"
- "zuul.project:{{ zuul.project.canonical_name }}"
when:
- zuul.pipeline is defined
- zuul.pipeline in ["check", "gate", "promote"]
- name: Set default labels for periodic and post pipelines
set_fact:
_default_labels:
- "nodepool.provider:{{ nodepool.provider }}"
- "zuul.executor:{{ zuul.executor.hostname }}"
- "zuul.job:{{ zuul.job }}"
- "zuul.pipeline:{{ zuul.pipeline }}"
- "zuul.project:{{ zuul.project.canonical_name }}"
when:
- zuul.pipeline is defined
- zuul.pipeline in ["periodic", "post"]