summaryrefslogtreecommitdiff
path: root/chromium/infra/config/lint-luci-milo.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/infra/config/lint-luci-milo.py
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-c30a6232df03e1efbd9f3b226777b07e087a1122.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/infra/config/lint-luci-milo.py')
-rwxr-xr-xchromium/infra/config/lint-luci-milo.py57
1 files changed, 26 insertions, 31 deletions
diff --git a/chromium/infra/config/lint-luci-milo.py b/chromium/infra/config/lint-luci-milo.py
index 76f974b3c63..578ffeb0fe6 100755
--- a/chromium/infra/config/lint-luci-milo.py
+++ b/chromium/infra/config/lint-luci-milo.py
@@ -7,7 +7,6 @@
import collections
import difflib
-import json
import os
import sys
@@ -23,36 +22,32 @@ import project_pb2
def compare_builders(name, main_builders, sub_builders):
# Checks that the builders on a subwaterfall on the main waterfall
# are consistent with the builders on that subwaterfall's main page.
- # Any build present in the main console must also be present in the
- # subwaterfall console, though the reverse is not necessarily true.
- # For the builders that are present, the entries must be the same with the
- # exception that the sub waterfall's entry will not have the subwaterfall name
- # as the first category component.
- def to_dict(builder, category_prefix=None):
- d = {'name': '.'.join(builder.name)}
- category = '|'.join(c for c in (category_prefix, builder.category) if c)
- if category:
- d['category'] = category
- if builder.short_name:
- d['short_name'] = builder.short_name
- return d
-
- main_list = [to_dict(b) for b in main_builders]
- required = set(d['name'] for d in main_list)
-
- # We don't require that every builder in the subwaterfall appear in the main
- # console, just that the ones that are present are the equivalent
- sub_list = [to_dict(b, name) for b in sub_builders]
- sub_list = [d for d in sub_list if d['name'] in required]
-
- if main_list != sub_list:
- print ('Entries differ between main waterfall and stand-alone {} waterfall:'
- .format(name))
- def to_json(obj):
- return json.dumps(obj, indent=2, separators=(',', ':'))
- print '\n'.join(difflib.unified_diff(
- to_json(sub_list).splitlines(), to_json(main_list).splitlines(),
- fromfile=name, tofile='main', lineterm=''))
+ # For example, checks that the builders on the "chromium.win" section
+ # are the same as on the dedicated standalone chromium.win waterfall.
+ def to_list(builders, category_prefix=''):
+ desc_list = []
+ for builder in builders:
+ desc_list.append('name: ' + ', '.join(builder.name))
+ # A bot with "chromium.win|foo|bar" on the main waterfall should have
+ # a category of "foo|bar" on the "chromium.win" subwaterfall.
+ category = builder.category
+ if category_prefix:
+ if category:
+ category = category_prefix + '|' + category
+ else:
+ category = category_prefix
+ desc_list.append('category: ' + category)
+ desc_list.append('short_name: ' + builder.short_name)
+ return desc_list
+ main_desc = to_list(main_builders)
+ sub_desc = to_list(sub_builders, name)
+
+ if main_desc != sub_desc:
+ print ('bot lists different between main waterfall ' +
+ 'and stand-alone %s waterfall:' % name)
+ print '\n'.join(difflib.unified_diff(main_desc, sub_desc,
+ fromfile='main', tofile=name,
+ lineterm=''))
print
return False
return True