From 2dfb08a49e5862ebfb4d87750d377560259393a3 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 10 Jul 2017 15:38:15 -0500 Subject: [PATCH] Actually run the unittests post playbooks Put the tasks into a role so that we can set zuul_work_dir in defaults.yaml so that this also works if we're setting a directory in a variable. Change-Id: I638f7682d086781178f2dc7517eb0fb09a5f2acd --- playbooks/unittests/post.yaml | 13 ++----------- roles/fetch-testr-output/defaults/main.yaml | 2 ++ roles/fetch-testr-output/tasks/main.yaml | 10 ++++++++++ zuul.yaml | 1 + 4 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 roles/fetch-testr-output/defaults/main.yaml create mode 100644 roles/fetch-testr-output/tasks/main.yaml diff --git a/playbooks/unittests/post.yaml b/playbooks/unittests/post.yaml index 3429000fc..b448ca523 100644 --- a/playbooks/unittests/post.yaml +++ b/playbooks/unittests/post.yaml @@ -1,12 +1,3 @@ - hosts: all - tasks: - - name: Collect test-results - synchronize: - dest: "{{ zuul.executor.log_root }}" - mode: pull - rsync_opts: - - "--ignore-missing-args" - src: "src/{{ zuul.project.canonical_name }}/{{ item }}" - with_items: - - "*testr_results.html.gz" - - "*testrepository.subunit.gz" + roles: + - fetch-testr-output diff --git a/roles/fetch-testr-output/defaults/main.yaml b/roles/fetch-testr-output/defaults/main.yaml new file mode 100644 index 000000000..a0afa22c5 --- /dev/null +++ b/roles/fetch-testr-output/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +zuul_work_dir: "src/{{ zuul.project.canonical_name }}" diff --git a/roles/fetch-testr-output/tasks/main.yaml b/roles/fetch-testr-output/tasks/main.yaml new file mode 100644 index 000000000..163226322 --- /dev/null +++ b/roles/fetch-testr-output/tasks/main.yaml @@ -0,0 +1,10 @@ +- name: Collect test-results + synchronize: + dest: "{{ zuul.executor.log_root }}" + mode: pull + rsync_opts: + - "--ignore-missing-args" + src: "{{ zuul_work_dir }}/{{ item }}" + with_items: + - "*testr_results.html.gz" + - "*testrepository.subunit.gz" diff --git a/zuul.yaml b/zuul.yaml index 298c716d1..e47215e6c 100644 --- a/zuul.yaml +++ b/zuul.yaml @@ -9,6 +9,7 @@ roles: - zuul: openstack-infra/zuul-jobs pre-run: playbooks/unittests/pre + post-run: playbooks/unittests/post - job: name: tox