From 002fdde8986fa5f22259e8b11c859a02b261ae28 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 5 Sep 2019 10:27:43 -0700 Subject: [PATCH] Flip the order of the emit-job-header tests This more accurate reflects how this is run by opendev. Note this is not strictly necessary to get in as the post-logs.yaml playbooks determine where things are uploaded anyway. However, this may be slightly easier for people to read in logs if things line up more closely to each other. Depends-On: https://review.opendev.org/680476 Change-Id: Ied902ea2b8c7b965447e16f91400586ca1f708e6 --- .../base-roles/emit-job-header.yaml | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/test-playbooks/base-roles/emit-job-header.yaml b/test-playbooks/base-roles/emit-job-header.yaml index 51991e1e3..abdd06503 100644 --- a/test-playbooks/base-roles/emit-job-header.yaml +++ b/test-playbooks/base-roles/emit-job-header.yaml @@ -1,25 +1,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] - # 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. @@ -43,3 +21,25 @@ - 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]