From f38d29a653f48c0a369fedfe8e24b21b25066ce6 Mon Sep 17 00:00:00 2001
From: Fabien Boucher <fboucher@redhat.com>
Date: Aug 02 2019 09:44:51 +0000
Subject: [PATCH 1/7] Propose a new run-tests-yml


---

diff --git a/playbooks/rpm/rpmtest.yaml b/playbooks/rpm/rpmtest.yaml
index 1f27eb7..eca5344 100644
--- a/playbooks/rpm/rpmtest.yaml
+++ b/playbooks/rpm/rpmtest.yaml
@@ -3,6 +3,7 @@
   roles:
     - repo-setup
     - run-tests-yml
+    - fetch-tests-yml-artifacts
   pre_tasks:
     - name: install system deps
       yum:
diff --git a/roles/fetch-tests-yml-artifacts/tasks/main.yml b/roles/fetch-tests-yml-artifacts/tasks/main.yml
new file mode 100644
index 0000000..e70d6fb
--- /dev/null
+++ b/roles/fetch-tests-yml-artifacts/tasks/main.yml
@@ -0,0 +1,5 @@
+- name: Fetch test artifacts
+  synchronize:
+    src: '{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/artifacts'
+    dest: '{{ zuul.executor.log_root }}/'
+    mode: pull
diff --git a/roles/run-tests-yml/files/standard-test-beakerlib/tasks/main.yaml b/roles/run-tests-yml/files/standard-test-beakerlib/tasks/main.yaml
deleted file mode 100644
index eecbf2b..0000000
--- a/roles/run-tests-yml/files/standard-test-beakerlib/tasks/main.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
----
-- name: Install packages
-  package:
-    name: "{{ required_packages }}"
-    state: latest
-
-- name: Run tests
-  command: ansible-playbook runtest.yml
-  args:
-    chdir: "{{ item }}"
-  with_items: "{{ tests }}"
diff --git a/roles/run-tests-yml/tasks/main.yaml b/roles/run-tests-yml/tasks/main.yaml
index a0d530f..72d9934 100644
--- a/roles/run-tests-yml/tasks/main.yaml
+++ b/roles/run-tests-yml/tasks/main.yaml
@@ -1,21 +1,15 @@
 ---
-- name: Install ansible.cfg
-  copy:
-    dest: "{{ zuul.project.src_dir }}/tests/ansible.cfg"
-    content: |
-      [defaults]
-      roles_path = .
-      stdout_callback = yaml
+- name: Disable update repo - mitigate network issue with it
+  command: dnf config-manager --set-disabled updates
+  become: yes
 
-- name: Copy mock role
-  synchronize:
-    src: "{{ item }}/"
-    dest: "{{ zuul.project.src_dir }}/tests/{{ item }}/"
-  with_items:
-    - standard-test-beakerlib
+- name: Install system dependencies
+  yum:
+    name: "ansible python2-dnf libselinux-python standard-test-roles"
+    state: latest
+  become: yes
 
 - name: Run the tests
-  command: ansible-playbook tests.yml
+  command: ansible-playbook tests/tests.yml
   become: yes
-  args:
-    chdir: "{{ zuul.project.src_dir }}/tests"
+  chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"

From 73afebd355941093fcc650a941c084a0e6b643e5 Mon Sep 17 00:00:00 2001
From: Fabien Boucher <fboucher@redhat.com>
Date: Aug 02 2019 16:42:13 +0000
Subject: [PATCH 2/7] Force python3 interpreter due to python2-dnf issue


---

diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index 4abafe0..4138301 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -9,6 +9,9 @@
       nodes:
         - name: mock-host
           label: cloud-fedora
+    host-vars:
+      mock-host:
+        ansible_python_interpreter: /usr/bin/python3
 
 - job:
     name: rawhide-rpm-koji-build

From 2691d7de4cd774fd18c961a643cc3acb8840ce1c Mon Sep 17 00:00:00 2001
From: Fabien Boucher <fboucher@redhat.com>
Date: Aug 02 2019 17:06:14 +0000
Subject: [PATCH 3/7] More jobs with python3 interpreter


---

diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index 4138301..88594d3 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -33,6 +33,9 @@
       nodes:
         - name: node
           label: cloud-fedora
+    host-vars:
+      mock-host:
+        ansible_python_interpreter: /usr/bin/python3
 
 - job:
     name: artifact-rpm-lint
@@ -42,3 +45,6 @@
       nodes:
         - name: node
           label: cloud-fedora
+    host-vars:
+      mock-host:
+        ansible_python_interpreter: /usr/bin/python3

From cf16ca26792d364bbfdf21b04f1f4fb7fa2d9158 Mon Sep 17 00:00:00 2001
From: Fabien Boucher <fboucher@redhat.com>
Date: Aug 02 2019 17:07:40 +0000
Subject: [PATCH 4/7] Fix node name


---

diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml
index 88594d3..40b1a32 100644
--- a/zuul.d/jobs.yaml
+++ b/zuul.d/jobs.yaml
@@ -34,7 +34,7 @@
         - name: node
           label: cloud-fedora
     host-vars:
-      mock-host:
+      node:
         ansible_python_interpreter: /usr/bin/python3
 
 - job:
@@ -46,5 +46,5 @@
         - name: node
           label: cloud-fedora
     host-vars:
-      mock-host:
+      node:
         ansible_python_interpreter: /usr/bin/python3

From b11eb6ad79677cbfe2c506320fc7f6fe6fa989ad Mon Sep 17 00:00:00 2001
From: Fabien Boucher <fboucher@redhat.com>
Date: Aug 02 2019 17:23:20 +0000
Subject: [PATCH 5/7] indent fix


---

diff --git a/roles/run-tests-yml/tasks/main.yaml b/roles/run-tests-yml/tasks/main.yaml
index 72d9934..45973d9 100644
--- a/roles/run-tests-yml/tasks/main.yaml
+++ b/roles/run-tests-yml/tasks/main.yaml
@@ -11,5 +11,5 @@
 
 - name: Run the tests
   command: ansible-playbook tests/tests.yml
+    chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
   become: yes
-  chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"

From 0a5ba750a0a94b68e7e798dba13a7aea9f07cf16 Mon Sep 17 00:00:00 2001
From: Fabien Boucher <fboucher@redhat.com>
Date: Aug 02 2019 22:06:41 +0000
Subject: [PATCH 6/7] fix wrong call


---

diff --git a/roles/run-tests-yml/tasks/main.yaml b/roles/run-tests-yml/tasks/main.yaml
index 45973d9..a8ee2c2 100644
--- a/roles/run-tests-yml/tasks/main.yaml
+++ b/roles/run-tests-yml/tasks/main.yaml
@@ -11,5 +11,6 @@
 
 - name: Run the tests
   command: ansible-playbook tests/tests.yml
+  args:
     chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
   become: yes

From dcf9f8cf8c960f59aee9ceabdb92d087ada14316 Mon Sep 17 00:00:00 2001
From: Fabien Boucher <fboucher@redhat.com>
Date: Aug 02 2019 22:17:27 +0000
Subject: [PATCH 7/7] fix sperated by space packages


---

diff --git a/roles/run-tests-yml/tasks/main.yaml b/roles/run-tests-yml/tasks/main.yaml
index a8ee2c2..2e68c9b 100644
--- a/roles/run-tests-yml/tasks/main.yaml
+++ b/roles/run-tests-yml/tasks/main.yaml
@@ -1,11 +1,7 @@
 ---
-- name: Disable update repo - mitigate network issue with it
-  command: dnf config-manager --set-disabled updates
-  become: yes
-
 - name: Install system dependencies
   yum:
-    name: "ansible python2-dnf libselinux-python standard-test-roles"
+    name: "ansible,python2-dnf,libselinux-python,standard-test-roles"
     state: latest
   become: yes
 

