zuul-jobs/test-playbooks/base-test-roles/emit-job-header.yaml
James E. Blair d6ae964f47 Avoid fstrings in test-prepare-workspace-git
Fstrings are not supported in python3.5 which is in use on Xenial.
We don't claim to support Xenial, but this is an easy regression
to avoid.

Also, add test jobs for this role so that we get feedback before
copying it to the prod roles.

Also, add a xenial test job to exercise it since we still have
Xenial nodes available.

Change-Id: Ifc773aa688adb1a01cfe691b3bdca0b3086658cd
2024-08-28 09:55:55 -07:00

46 lines
2.0 KiB
YAML

# Note that the order of these two plays is important. We want the second one
# to run to be the one the creates the correct log path for the currently
# running system.
- name: Test the emit-job-header role without swift
hosts: all
roles:
- role: emit-job-header
zuul_log_url: "http://logs.openstack.org"
post_tasks:
# All emit-job-header does is a debug statement so the worst that would
# happen would be that the debug task would fail outright and we'd prevent
# something breaking that debug statement from merging just by running it.
# However, the emit-job-header role includes the set-zuul-log-path-fact
# role. We can only test for zuul_log_path against changes, though.
- name: Assert zuul_log_path by set-zuul-log-path-fact for a change
assert:
that:
- zuul_log_path is defined
- zuul.change in zuul_log_path
- zuul.patchset in zuul_log_path
- zuul.pipeline in zuul_log_path
- zuul.job in zuul_log_path
- zuul.build[:3] != zuul_log_path[:3]
- name: Test the emit-job-header role with swift
hosts: all
roles:
- role: emit-job-header
zuul_log_url: "http://logs.openstack.org"
zuul_log_path_shard_build: true
post_tasks:
# All emit-job-header does is a debug statement so the worst that would
# happen would be that the debug task would fail outright and we'd prevent
# something breaking that debug statement from merging just by running it.
# However, the emit-job-header role includes the set-zuul-log-path-fact
# role. We can only test for zuul_log_path against changes, though.
- name: Assert zuul_log_path by set-zuul-log-path-fact for a change
assert:
that:
- zuul_log_path is defined
- zuul.change in zuul_log_path
- zuul.patchset in zuul_log_path
- zuul.pipeline in zuul_log_path
- zuul.job in zuul_log_path
- zuul.build[:3] == zuul_log_path[:3]