blob: 89d3c236af9f2ed8a5a6788c6b6172870113422f [file] [log] [blame]
Brian Sheedya487bbc2021-07-12 23:12:531# Copyright 2021 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4"""GPU-specific implementation of the unexpected passes' builders module."""
5
6from __future__ import print_function
7
Brian Sheedyb6ab0202021-07-14 18:46:118import os
9import sys
10
Brian Sheedya487bbc2021-07-12 23:12:5311from unexpected_passes_common import builders
12
Brian Sheedyb6ab0202021-07-14 18:46:1113CHROMIUM_SRC_DIR = os.path.realpath(
14 os.path.join(os.path.dirname(__file__), '..', '..', '..', '..'))
15TOOLS_PERF_DIR = os.path.join(CHROMIUM_SRC_DIR, 'tools', 'perf')
16
17sys.path.append(TOOLS_PERF_DIR)
18from chrome_telemetry_build import android_browser_types as abt
19sys.path.remove(TOOLS_PERF_DIR)
20
Brian Sheedya487bbc2021-07-12 23:12:5321
22class GpuBuilders(builders.Builders):
23 def __init__(self):
24 super(GpuBuilders, self).__init__()
Brian Sheedyb6ab0202021-07-14 18:46:1125 self._isolate_names = None
Brian Sheedya487bbc2021-07-12 23:12:5326 self._fake_ci_builders = None
27
28 def _BuilderRunsTestOfInterest(self, test_map, suite):
29 tests = test_map.get('isolated_scripts', [])
30 for t in tests:
31 if t.get('isolate_name') not in self.GetIsolateNames():
32 continue
33 if suite in t.get('args', []):
34 return True
35 return False
36
37 def GetIsolateNames(self):
Brian Sheedyb6ab0202021-07-14 18:46:1138 if self._isolate_names is None:
39 self._isolate_names = {
40 'fuchsia_telemetry_gpu_integration_test',
41 'telemetry_gpu_integration_test',
42 }
43 # Android targets are split based on binary type, so add those using the
44 # maintained list of suffixes.
45 for suffix in abt.TELEMETRY_ANDROID_BROWSER_TARGET_SUFFIXES:
46 self._isolate_names.add('telemetry_gpu_integration_test' + suffix)
47 return self._isolate_names
Brian Sheedya487bbc2021-07-12 23:12:5348
49 def GetFakeCiBuilders(self):
50 if self._fake_ci_builders is None:
51 # Go from try -> CI then reverse the mapping so that there's less of a
52 # chance of typos being introduced in the repeated trybot names.
53 fake_try_builders = {
54 # chromium.gpu.fyi
55 'android_angle_rel_ng': [
56 'ANGLE GPU Android Release (Nexus 5X)',
57 ],
58 'android_optional_gpu_tests_rel': [
59 'Optional Android Release (Nexus 5X)',
60 'Optional Android Release (Pixel 4)',
61 ],
62 'linux-angle-rel': [
63 'ANGLE GPU Linux Release (Intel HD 630)',
64 'ANGLE GPU Linux Release (NVIDIA)',
65 ],
66 'linux_optional_gpu_tests_rel': [
67 'Optional Linux Release (Intel HD 630)',
68 'Optional Linux Release (NVIDIA)',
69 ],
70 'mac_optional_gpu_tests_rel': [
71 'Optional Mac Release (Intel)',
72 'Optional Mac Retina Release (AMD)',
73 'Optional Mac Retina Release (NVIDIA)',
74 ],
75 'win_optional_gpu_tests_rel': [
76 'Optional Win10 x64 Release (Intel HD 630)',
77 'Optional Win10 x64 Release (NVIDIA)',
78 ],
79 }
80
81 self._fake_ci_builders = {}
82 for try_builder, ci_builder_list in fake_try_builders.items():
83 for ci in ci_builder_list:
84 self._fake_ci_builders[ci] = try_builder
85
86 return self._fake_ci_builders
87
88 def GetNonChromiumBuilders(self):
89 return {
90 'Win V8 FYI Release (NVIDIA)',
91 'Mac V8 FYI Release (Intel)',
92 'Linux V8 FYI Release - pointer compression (NVIDIA)',
93 'Linux V8 FYI Release (NVIDIA)',
94 'Android V8 FYI Release (Nexus 5X)',
95 }