From 7e2b87f99a63886baa2292a45ff8e23d7dcaeac6 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Mon, 7 Dec 2015 15:04:27 -0800 Subject: [PATCH] openqa: always fully re-load the test templates I didn't do this originally because I was trying to make it only show changed when something had really changed, but it was too conservative - it wouldn't update when a test definition changed, only when one was added. Doing it manually is a bit annoying (you have to do the sed step and the ownership change) so it's better to let you just re-run the play to update the tests, even if it does mean getting the occasional spurious changed state. --- roles/openqa/server/tasks/main.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/openqa/server/tasks/main.yml b/roles/openqa/server/tasks/main.yml index 96bcb17f6a..967a3a386e 100644 --- a/roles/openqa/server/tasks/main.yml +++ b/roles/openqa/server/tasks/main.yml @@ -65,6 +65,7 @@ git: repo: https://bitbucket.org/rajcze/openqa_fedora dest: /var/lib/openqa/share/tests/fedora + register: gittests - name: Have tests owned by geekotest file: path=/var/lib/openqa/share/tests/fedora owner=geekotest recurse=yes @@ -172,10 +173,11 @@ - name: Patch repo URLs in templates shell: "cp /var/lib/openqa/share/tests/fedora/templates /tmp && sed -i -e 's,dl.fedoraproject,dl.phx2.fedoraproject,g' /tmp/templates" + when: "gittests|changed" changed_when: "1 != 1" +# This will always show as changed, even when nothing in the templates +# changed; this is a bit hard to fix - name: Load tests - shell: "/tmp/templates | grep 'added => [1-9]'" - register: templates - changed_when: "templates.rc == 0" - failed_when: "1 != 1" + shell: "/tmp/templates --clean" + when: "gittests|changed"