From 4c05bc26680be8b31a9f6238d29e0d623ce00388 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Oct 21 2020 08:54:53 +0000 Subject: Add fmf-tests on testing-farm jobs support Add a trigger job running on a Zuul executor node. It detects whether a .fmf directory exist and if not tell Zuul to skip the job called rpm-tmt-test-on-testing-farm. Add rpm-tmt-test-on-testing-farm with all branches matcher. Expect 3 roles in fedora-zuul-jobs: - testing-farm-secret - testing-farm-run-test - testing-farm-fetch-artifacts Depends-on: https://pagure.io/fedora-zuul-jobs/pull-request/74 --- diff --git a/playbooks/rpm/check-for-fmf-tests.yaml b/playbooks/rpm/check-for-fmf-tests.yaml new file mode 100644 index 0000000..a00bb75 --- /dev/null +++ b/playbooks/rpm/check-for-fmf-tests.yaml @@ -0,0 +1,13 @@ +--- +- hosts: localhost + tasks: + - name: Check for .tmt exists + stat: + path: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/.fmf" + register: tests_stat + - zuul_return: + data: + zuul: + child_jobs: + - rpm-tmt-test-on-testing-farm + when: not tests_stat.stat.isdir diff --git a/playbooks/testing-farm/fetch.yaml b/playbooks/testing-farm/fetch.yaml new file mode 100644 index 0000000..2de87c4 --- /dev/null +++ b/playbooks/testing-farm/fetch.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - testing-farm-fetch-artifacts diff --git a/playbooks/testing-farm/run.yaml b/playbooks/testing-farm/run.yaml new file mode 100644 index 0000000..f6cecc5 --- /dev/null +++ b/playbooks/testing-farm/run.yaml @@ -0,0 +1,6 @@ +- hosts: all + tasks: + - include_role: + name: testing-farm-secret + - include_role: + name: testing-farm-run-test diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 525e8fa..e80860f 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -7,6 +7,14 @@ run: playbooks/rpm/check-for-tests.yaml - job: + name: check-for-fmf-tests + parent: null + nodeset: + nodes: [] + description: Check the project has a .fmf directory + run: playbooks/rpm/check-for-fmf-tests.yaml + +- job: name: base-cloud-fedora-latest abstract: true description: base job to run on a Fedora virtual machine @@ -137,3 +145,57 @@ target: f31 release: f31 scratch_build: false + +# Jobs to run rpm validation on testing farm +# https://packit.dev/testing-farm/ +- job: + name: base-rpm-tmt-test-on-testing-farm + abstract: true + protected: true + description: common base job for running fmf test on testing-farm + # 2h30 timeout + timeout: 9000 + nodeset: fedora-33-container + roles: + - zuul: fedora-zuul-jobs + secrets: + - testing_farm_zuul_fedora_ci_key + requires: repo + run: playbooks/testing-farm/run.yaml + post-run: playbooks/testing-farm/fetch.yaml + +- job: + name: rpm-tmt-test-on-testing-farm + parent: base-rpm-tmt-test-on-testing-farm + final: true + description: job for running fmf test on testing-farm + branches: master + vars: + compose: Fedora-Rawhide + +- job: + name: rpm-tmt-test-on-testing-farm + parent: base-rpm-tmt-test-on-testing-farm + final: true + description: job for running fmf test on testing-farm + branches: f33 + vars: + compose: Fedora-33 + +- job: + name: rpm-tmt-test-on-testing-farm + parent: base-rpm-tmt-test-on-testing-farm + final: true + description: job for running fmf test on testing-farm + branches: f32 + vars: + compose: Fedora-32 + +- job: + name: rpm-tmt-test-on-testing-farm + parent: base-rpm-tmt-test-on-testing-farm + final: true + description: job for running fmf test on testing-farm + branches: f31 + vars: + compose: Fedora-31