From 93182b32c6f971cc37872d499af562e0a80f782c Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Dec 01 2021 12:43:16 +0000 Subject: Re-enable check-for-tests job and its playbook This reverts commit 3e147f11e56f9544a2bcef1890b986122d41e65c. Also the playbook is updated to run rpm-test if sti tests.yaml file is present and if not simply skip it. --- diff --git a/playbooks/rpm/check-for-tests.yaml b/playbooks/rpm/check-for-tests.yaml new file mode 100644 index 0000000..68d307f --- /dev/null +++ b/playbooks/rpm/check-for-tests.yaml @@ -0,0 +1,18 @@ +--- +- hosts: localhost + tasks: + - name: Check for tests/tests.yml exists + stat: + path: "{{ zuul.project.src_dir }}/tests/tests.yml" + register: tests_stat + - zuul_return: + data: + zuul: + child_jobs: + - rpm-test + when: tests_stat.stat.exists + - zuul_return: + data: + zuul: + child_jobs: [] + when: not tests_stat.stat.exists diff --git a/zuul.d/jobs.dhall b/zuul.d/jobs.dhall index 9536d05..e9bc913 100644 --- a/zuul.d/jobs.dhall +++ b/zuul.d/jobs.dhall @@ -74,6 +74,15 @@ let executor_nodeset = Zuul.Nodeset.Inline Zuul.Nodeset.empty let default_nodeset = Nodesets.getName Nodesets.Type.Fedora-34-Container +let check_for_tests = + Zuul.Job::{ + , name = "${job-prefix}check-for-tests" + , description = Some "Check the project has a tests/tests.yml" + , branches = Some Branches.allText + , run = Some "playbooks/rpm/check-for-tests.yaml" + , nodeset = Some executor_nodeset + } + let check_for_sti_tests = Zuul.Job::{ , name = "${job-prefix}check-for-sti-tests" @@ -310,6 +319,7 @@ let generateTMTTestsJobs = let Jobs = [ clean_stalled_koji_tasks + , check_for_tests , check_for_sti_tests , check_for_fmf_tests , check_for_arches diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 86c220e..797ca2b 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -13,6 +13,20 @@ secret: krb_keytab - job: + name: check-for-tests + description: Check the project has a tests/tests.yml + run: playbooks/rpm/check-for-tests.yaml + branches: + - rawhide + - f35 + - f34 + - f33 + - epel8 + - main + nodeset: + nodes: [] + +- job: name: check-for-sti-tests description: Check the project has a tests/tests.yml run: playbooks/rpm/check-for-sti-tests.yaml