Skip to content

Commit 18c29a6

Browse files
author
AdrianoDee
committed
Have upgrade matrix failing for duplicate suffixes
1 parent e0cb38f commit 18c29a6

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Configuration/PyReleaseValidation/python/MatrixUtil.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,8 @@ def genvalid(fragment,d,suffix='all',fi='',dataSet=''):
266266
c['cfg']=fragment
267267
return c
268268

269-
269+
def check_dups(input):
270+
seen = set()
271+
dups = set(x for x in input if x in seen or seen.add(x))
272+
273+
return dups

Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from copy import copy, deepcopy
22
from collections import OrderedDict
3-
from .MatrixUtil import merge, Kby, Mby
3+
from .MatrixUtil import merge, Kby, Mby, check_dups
44
import re
55

66
U2000by1={'--relval': '2000,1'}
@@ -2819,13 +2819,18 @@ def condition(self, fragment, stepList, key, hasHarvest):
28192819
offset = 0.9001,
28202820
)
28212821

2822-
# check for duplicate offsets
2823-
offsets = [specialWF.offset for specialType,specialWF in upgradeWFs.items()]
2824-
seen = set()
2825-
dups = set(x for x in offsets if x in seen or seen.add(x))
2822+
# check for duplicates in offsets or suffixes
2823+
offsets = [specialWF.offset for specialType,specialWF in upgradeWFs.items()]
2824+
suffixes = [specialWF.suffix for specialType,specialWF in upgradeWFs.items()]
2825+
2826+
dups = check_dups(offsets)
28262827
if len(dups)>0:
28272828
raise ValueError("Duplicate special workflow offsets not allowed: "+','.join([str(x) for x in dups]))
28282829

2830+
dups = check_dups(suffixes)
2831+
if len(dups)>0:
2832+
raise ValueError("Duplicate special workflow suffixes not allowed: "+','.join([str(x) for x in dups]))
2833+
28292834
upgradeProperties = {}
28302835

28312836
upgradeProperties[2017] = {

0 commit comments

Comments
 (0)