From 9101dd322c1206033d31b115c382c2b2298b90fa Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 28 Jul 2022 08:11:20 -0700 Subject: [PATCH] Support subsets of platforms in update-test-platforms This lets us specify that we want to run a job on all "ubuntu" platforms. Change-Id: Ib466d719d3de241a6bd31ed4896cbeb96452aea8 --- tools/update-test-platforms.py | 42 ++++++++++++++++++---------- zuul-tests.d/general-roles-jobs.yaml | 2 +- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/tools/update-test-platforms.py b/tools/update-test-platforms.py index 28faa82fb..16d036dd2 100755 --- a/tools/update-test-platforms.py +++ b/tools/update-test-platforms.py @@ -29,24 +29,39 @@ import ruamellib # There are fedora- and debian-latest nodesets, but they can't be used # in the multinode jobs, so just use the real labels everywhere. -PLATFORMS = [ - # 'gentoo-17-0-systemd', +CENTOS_PLATFORMS = [ 'centos-7', 'centos-8-stream', 'centos-9-stream', - 'debian-bullseye', +] +DEBIAN_PLATFORMS = [ 'debian-buster', - 'fedora-35', - 'opensuse-15', + 'debian-bullseye', +] +UBUNTU_PLATFORMS = [ 'ubuntu-bionic', 'ubuntu-focal', 'ubuntu-jammy', ] +OTHER_PLATFORMS = [ + 'fedora-35', + # 'gentoo-17-0-systemd', + 'opensuse-15', +] +ALL_PLATFORMS = (CENTOS_PLATFORMS + DEBIAN_PLATFORMS + + UBUNTU_PLATFORMS + OTHER_PLATFORMS) # insert a platform from above to make it non-voting NON_VOTING = [ ] +TAGS = { + 'centos-platforms': CENTOS_PLATFORMS, + 'debian-platforms': DEBIAN_PLATFORMS, + 'ubuntu-platforms': UBUNTU_PLATFORMS, + 'all-platforms': ALL_PLATFORMS, +} + # Insert a job to make that single job non-voting NON_VOTING_JOBS = [ 'zuul-jobs-test-multinode-roles-gentoo-17-0-systemd', @@ -89,15 +104,14 @@ def handle_file(fn): continue outdata.append(obj) tags = job.get('tags', []) - all_platforms = False - if 'all-platforms-multinode' in tags: - multinode = True - all_platforms = True - elif 'all-platforms' in tags: - all_platforms = True - multinode = False - if all_platforms: - for platform in PLATFORMS: + platforms = set() + multinode = 'multinode' in tags + for key, data in TAGS.items(): + if key in tags: + platforms.update(data) + platforms = sorted(platforms) + if platforms: + for platform in platforms: voting = False if platform in NON_VOTING else True ojob = CommentedMap() ojob['name'] = job['name'] + '-' + platform diff --git a/zuul-tests.d/general-roles-jobs.yaml b/zuul-tests.d/general-roles-jobs.yaml index 04d12084a..e588d8624 100644 --- a/zuul-tests.d/general-roles-jobs.yaml +++ b/zuul-tests.d/general-roles-jobs.yaml @@ -506,7 +506,7 @@ These roles are tested together in this job because they interact with each other. - tags: all-platforms-multinode + tags: all-platforms multinode abstract: true run: test-playbooks/multinode/multinode.yaml files: