Commit d15f1a77 authored by Ned Nguyen's avatar Ned Nguyen Committed by Commit Bot

Reland "Add perf/core/bot_platforms.py file that contain metadata about all perf builders"

This is a reland of 8c125d449f30cb622e0f8f4b919ad45b4b05bbb9

Original change's description:
> Add perf/core/bot_platforms.py file that contain metadata about all perf builders
>
> Bug:871746,863768
> Cq-Include-Trybots: master.tryserver.chromium.perf:obbs_fyi
> Change-Id: If2a9f5344d4226aa56b71dabf094cc49c5006bb8
> Reviewed-on: https://chromium-review.googlesource.com/1169127
> Reviewed-by: Juan Antonio Navarro Pérez <perezju@chromium.org>
> Commit-Queue: Ned Nguyen <nednguyen@google.com>

Bug: 871746, 863768
Change-Id: Id3efcff245684cc55237a2a6c4c26d51e65fa797
Cq-Include-Trybots: master.tryserver.chromium.perf:obbs_fyi

TBR=perezju@chromium.org

Change-Id: Id3efcff245684cc55237a2a6c4c26d51e65fa797
Reviewed-on: https://chromium-review.googlesource.com/1169882Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#581900}
parent 51459a28
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import urllib
class PerfPlatform(object):
def __init__(self, name, is_fyi=False):
self._name = name
self._is_fyi = is_fyi
@property
def name(self):
return self._name
@property
def buildbot_url(self):
return ('https://ci.chromium.org/buildbot/chromium.perf/%s/' %
urllib.quote(self._name))
# Linux
LINUX = PerfPlatform('linux-perf')
# Mac
MAC_HIGH_END = PerfPlatform('mac-10_13_laptop_high_end-perf')
MAC_LOW_END = PerfPlatform('mac-10_12_laptop_low_end-perf')
# Win
WIN_10 = PerfPlatform('win-10-perf')
WIN_7 = PerfPlatform('Win 7 Perf')
WIN_7_GPU = PerfPlatform('Win 7 Nvidia GPU Perf')
# Android
ANDROID_GO = PerfPlatform('android-go-perf')
ANDROID_NEXUS_5 = PerfPlatform('Android Nexus5 Perf')
ANDROID_NEXUS_5X = PerfPlatform('android-nexus5x-perf')
ANDROID_NEXUS_5X_WEBVIEW = PerfPlatform('Android Nexus5X WebView Perf')
ANDROID_NEXUS_6_WEBVIEW = PerfPlatform('Android Nexus6 WebView Perf')
ALL_PLATFORMS = {
p for p in locals().values() if isinstance(p, PerfPlatform)
}
ALL_PLATFORM_NAMES = {
p.name for p in ALL_PLATFORMS
}
......@@ -7,6 +7,7 @@ import os
import json
from core import path_util
from core import bot_platforms
_VALID_SWARMING_DIMENSIONS = {
'gpu', 'device_ids', 'os', 'pool', 'perf_tests', 'perf_tests_with_args',
......@@ -124,8 +125,9 @@ def _IsTestingBuilder(builder_name, builder_data):
return 'isolated_scripts' in builder_data
def ValidatePerfConfigFile(file_handle):
def ValidatePerfConfigFile(file_handle, is_main_perf_waterfall):
perf_data = json.load(file_handle)
perf_testing_builder_names = set()
for key, value in perf_data.iteritems():
if not _IsBuilderName(key):
continue
......@@ -133,8 +135,18 @@ def ValidatePerfConfigFile(file_handle):
pass
elif _IsTestingBuilder(builder_name=key, builder_data=value):
ValidateTestingBuilder(builder_name=key, builder_data=value)
perf_testing_builder_names.add(key)
else:
raise ValueError('%s has unrecognizable type: %s' % key)
if (is_main_perf_waterfall and
perf_testing_builder_names != bot_platforms.ALL_PLATFORM_NAMES):
raise ValueError(
'Found mismatches between actual perf waterfall builders and platforms '
'in core.bot_platforms. Please update the platforms in '
'bot_platforms.py.\nPlatforms should be aded to core.bot_platforms:%s'
'\nPlatforms should be removed from core.bot_platforms:%s' % (
perf_testing_builder_names - bot_platforms.ALL_PLATFORM_NAMES,
bot_platforms.ALL_PLATFORM_NAMES - perf_testing_builder_names))
def main(args):
......@@ -148,7 +160,7 @@ def main(args):
with open(fyi_waterfall_file) as f:
ValidatePerfConfigFile(f)
ValidatePerfConfigFile(f, False)
with open(waterfall_file) as f:
ValidatePerfConfigFile(f)
ValidatePerfConfigFile(f, True)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment