From 40866d03672d0d6a904262d07bb122044b4b0d12 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 24 Dec 2024 10:33:38 +0100 Subject: [PATCH] Add centralized defenition for molecule jobs In order to centrally manage jobs launching molecule a defined jobs and project-template added. At the moment it's relying on tox to execute molecule. While we can run molecule with gate-check-commit.sh, it's obviously better for development to have at least some local testing present, that does not heavily depend on in-zuul logic. Depends-On: https://review.opendev.org/c/openstack/requirements/+/938224 Change-Id: Ic9b3fa32236279c1cf991593e831bd950f1adc0a --- test-requirements.txt | 6 ++++++ zuul.d/jobs.yaml | 26 ++++++++++++++++++++++++++ zuul.d/project-templates.yaml | 13 +++++++++++++ 3 files changed, 45 insertions(+) diff --git a/test-requirements.txt b/test-requirements.txt index a31031b2b8..a9890e532f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,3 +11,9 @@ flake8 # MIT ansible-lint==24.12.2 # MIT netaddr>=0.7.18 # BSD Jinja2>=2.10 # BSD + +# Requirements for molecule jobs +ansible-core==2.17.5 # GPL-3.0 +docker>=7.0.0 # Apache-2.0 +molecule==24.12.0 # MIT +molecule-plugins[docker]==23.6.0 # MIT diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 5c530d4873..770525413d 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -635,6 +635,14 @@ parent: openstack-ansible-deploy-aio nodeset: ubuntu-jammy +- job: + name: openstack-ansible-tox-molecule-ubuntu-jammy + parent: tox-molecule + vars: + tox_environment: + TEST_BRANCH: "{{ zuul.branch }}" + DOCKER_REGISTRY: quay.io/gotmax23 + DOCKER_IMAGE_TAG: ubuntu-systemd:jammy # centos 9 stream - job: @@ -732,6 +740,15 @@ parent: openstack-ansible-deploy-aio nodeset: centos-9-stream +- job: + name: openstack-ansible-tox-molecule-centos-9-stream + parent: tox-molecule + vars: + tox_environment: + TEST_BRANCH: "{{ zuul.branch }}" + DOCKER_REGISTRY: quay.io/gotmax23 + DOCKER_IMAGE_TAG: centos-systemd:stream9 + # debian bookworm - job: @@ -794,6 +811,15 @@ parent: openstack-ansible-deploy-aio nodeset: debian-bookworm +- job: + name: openstack-ansible-tox-molecule-debian-bookworm + parent: tox-molecule + vars: + tox_environment: + TEST_BRANCH: "{{ zuul.branch }}" + DOCKER_REGISTRY: quay.io/gotmax23 + DOCKER_IMAGE_TAG: debian-systemd:bookworm + # rocky linux 9 - job: name: openstack-ansible-deploy-aio_lxc-rockylinux-9 diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index 852fcd6149..5f7987776a 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -314,6 +314,19 @@ - openstack-ansible-deploy-hosts_lxc_overlayfs-debian-bookworm - openstack-ansible-deploy-hosts_lxc_overlayfs-rockylinux-9 +- project-template: + name: openstack-ansible-molecule + check: + jobs: + - openstack-ansible-tox-molecule-centos-9-stream + - openstack-ansible-tox-molecule-debian-bookworm + - openstack-ansible-tox-molecule-ubuntu-jammy + gate: + jobs: + - openstack-ansible-tox-molecule-centos-9-stream + - openstack-ansible-tox-molecule-debian-bookworm + - openstack-ansible-tox-molecule-ubuntu-jammy + - project-template: name: openstack-ansible-deploy-guide-jobs description: |