diff --git a/.zuul.d/shared-jobs.yaml b/.zuul.d/shared-jobs.yaml new file mode 100644 index 0000000..1dc77da --- /dev/null +++ b/.zuul.d/shared-jobs.yaml @@ -0,0 +1,15 @@ +# TODO(pabelanger): Remove once https://review.openstack.org/593150 is merged. +- job: + name: windmill-tox-with-sudo + parent: tox + run: tests/playbooks/windmill-tox-with-sudo/run.yaml + protected: true + +- job: + name: windmill-tox-molecule + parent: windmill-tox-with-sudo + pre-run: tests/playbooks/molecule/pre.yaml + post-run: tests/playbooks/molecule/post.yaml + vars: + tox_envlist: molecule + tox_install_siblings: false diff --git a/tests/playbooks/molecule/post.yaml b/tests/playbooks/molecule/post.yaml new file mode 100644 index 0000000..3d3eb0a --- /dev/null +++ b/tests/playbooks/molecule/post.yaml @@ -0,0 +1,18 @@ +- hosts: all + tasks: + - name: Ensure ara-report directory exists + file: + path: "{{ zuul_output_dir }}/logs/logs/ara-report" + state: directory + + - name: Copy ARA database to ara-report directory + shell: "cp ~/.ara/ansible.sqlite {{ zuul_output_dir }}/logs/logs/ara-report" + + # TODO: Migrate to fetch-zuul-logs when + # https://review.openstack.org/#/c/583346/ is merged. + - name: Collect log output + synchronize: + dest: "{{ zuul.executor.log_root }}/" + mode: pull + src: "{{ zuul_output_dir }}/logs/" + verify_host: true diff --git a/tests/playbooks/molecule/pre.yaml b/tests/playbooks/molecule/pre.yaml new file mode 100644 index 0000000..7316d75 --- /dev/null +++ b/tests/playbooks/molecule/pre.yaml @@ -0,0 +1,10 @@ +- hosts: all + tasks: + # TODO(pabelanger): Remove once this lands in our base job in + # project-config. + - name: Execute ensure-output-dirs role + include_role: + name: ensure-output-dirs + + - name: Reset SSH connection for new group + meta: reset_connection diff --git a/tests/playbooks/windmill-tox-with-sudo/run.yaml b/tests/playbooks/windmill-tox-with-sudo/run.yaml new file mode 100644 index 0000000..22f8209 --- /dev/null +++ b/tests/playbooks/windmill-tox-with-sudo/run.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - tox