update-test-platforms.py : handle non-voting jobs

Add a non-voting platform dictionary so we can easily unblock the gate
via regenerating the automated jobs if one platform is having
temporary issues.  This adds "-nv" to the job name to make it clear
what is happening, and sets the job to "voting: false".

opensuse-15 is in this list, as a follow-on from the manual
(gate-unblocking) update I22d4cc02abaecb23d85aec3d415b43501ab1e0d2

Also, if a non-autogenerated job defined itself as non-voting, it
should not be put in the gate queue.  Handle this too.

During regeneration, I noticed that centos-8 was not in the list.  Add
it.

Change-Id: If41da9089a961dc27cda954924c17104e622dacc
This commit is contained in:
Ian Wienand 2019-11-25 11:07:42 +11:00
parent f1cb8842a6
commit b2646c3f30
2 changed files with 49 additions and 5 deletions

View File

@ -30,6 +30,7 @@ import ruamellib
PLATFORMS = [
'centos-7',
'centos-8',
'debian-stretch',
'fedora-29',
'gentoo-17-0-systemd',
@ -40,6 +41,11 @@ PLATFORMS = [
'ubuntu-xenial',
]
NON_VOTING = [
# Sun Nov 24 22:41:16 UTC 2019 : unresolved issues with the mirror
'opensuse-15'
]
def get_nodeset(platform, multinode):
d = CommentedMap()
@ -64,7 +70,9 @@ def handle_file(fn):
data = yaml.load(open(fn))
outdata = []
outprojects = []
joblist = []
joblist_check = []
joblist_gate = []
has_non_voting = False
for obj in data:
if 'job' in obj:
job = obj['job']
@ -81,8 +89,13 @@ def handle_file(fn):
multinode = False
if all_platforms:
for platform in PLATFORMS:
voting = False if platform in NON_VOTING else True
ojob = CommentedMap()
ojob['name'] = job['name'] + '-' + platform
if not voting:
ojob['name'] += '-nv'
ojob['voting'] = False
has_non_voting = True
desc = job['description'].split('\n')[0]
ojob['description'] = desc + ' on ' \
+ platform
@ -90,9 +103,16 @@ def handle_file(fn):
ojob['tags'] = 'auto-generated'
ojob['nodeset'] = get_nodeset(platform, multinode)
outdata.append({'job': ojob})
joblist.append(ojob['name'])
joblist_check.append(ojob['name'])
if voting:
joblist_gate.append(ojob['name'])
else:
joblist.append(job['name'])
joblist_check.append(job['name'])
# don't append non-voting jobs to gate
if job.get('voting', True):
joblist_gate.append(job['name'])
else:
has_non_voting = True
elif 'project' in obj:
outprojects.append(obj)
else:
@ -100,8 +120,11 @@ def handle_file(fn):
# We control the last project stanza
outdata.extend(outprojects)
project = outprojects[-1]['project']
project['check']['jobs'] = joblist
project['gate']['jobs'] = joblist
project['check']['jobs'] = joblist_check
# Use the same dictionary if there are no non-voting jobs
# (i.e. check is the same as gate); this gives nicer YAML output
# using dictionary anchors
project['gate']['jobs'] = joblist_gate if has_non_voting else joblist_check
with open(fn, 'w') as f:
yaml.dump(outdata, stream=f)

View File

@ -301,6 +301,25 @@
nodes:
- secondary
- job:
name: zuul-jobs-test-multinode-roles-centos-8
description: Tests multinode setup roles on centos-8
parent: zuul-jobs-test-multinode-roles
tags: auto-generated
nodeset:
nodes:
- name: primary
label: centos-8
- name: secondary
label: centos-8
groups:
- name: switch
nodes:
- primary
- name: peers
nodes:
- secondary
- job:
name: zuul-jobs-test-multinode-roles-debian-stretch
description: Tests multinode setup roles on debian-stretch
@ -496,6 +515,7 @@
- zuul-jobs-test-netconsole
- zuul-jobs-test-dstat-graph
- zuul-jobs-test-multinode-roles-centos-7
- zuul-jobs-test-multinode-roles-centos-8
- zuul-jobs-test-multinode-roles-debian-stretch
- zuul-jobs-test-multinode-roles-fedora-29
- zuul-jobs-test-multinode-roles-gentoo-17-0-systemd
@ -525,6 +545,7 @@
- zuul-jobs-test-netconsole
- zuul-jobs-test-dstat-graph
- zuul-jobs-test-multinode-roles-centos-7
- zuul-jobs-test-multinode-roles-centos-8
- zuul-jobs-test-multinode-roles-debian-stretch
- zuul-jobs-test-multinode-roles-fedora-29
- zuul-jobs-test-multinode-roles-gentoo-17-0-systemd