Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/builders.py

Issue 1939843002: Replace webkitpy standalone builders functions with instantiable class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved builders out of port, updated comment Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright (C) 2011 Google Inc. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are
5 # met:
6 #
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer
11 # in the documentation and/or other materials provided with the
12 # distribution.
13 # * Neither the name of Google Inc. nor the names of its
14 # contributors may be used to endorse or promote products derived from
15 # this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 import re
30
31 """Represents builder bots running layout tests.
32
33 This class is used to keep a list of all builder bots running layout tests on
34 the Chromium waterfall. There are other waterfalls that run layout tests but
35 this list is the one we care about in the context of TestExpectatoins. The
36 builders are hard coded in the constructor but can be overridden for unit tests.
37
38 """
39 class Builders(object):
40
41 def __init__(self):
42 """ In this dictionary, each item stores:
43
44 * port_name -- a fully qualified port name
45 * rebaseline_override_dir -- (optional) directory to put baselines i n instead of where
46 you would normally put them. This is useful when we don't have bots that cover
47 particular configurations; so, e.g., you might support mac-mou ntainlion but not
48 have a mac-mountainlion bot yet, so you'd want to put the mac- lion results into
49 platform/mac temporarily.
50 * specifiers -- TestExpectation specifiers for that config. Valid va lues are found in
51 TestExpectationsParser._configuration_tokens_list
52 """
53 self._exact_matches = {
54 "WebKit Win7": {"port_name": "win-win7", "specifiers": ['Win7', 'Rel ease']},
55 "WebKit Win7 (dbg)": {"port_name": "win-win7", "specifiers": ['Win7' , 'Debug']},
56 "WebKit Win10": {"port_name": "win-win10", "specifiers": ['Win10', ' Release']},
57 # FIXME: Rename this to 'WebKit Linux Precise'
58 "WebKit Linux": {"port_name": "linux-precise", "specifiers": ['Preci se', 'Release']},
59 "WebKit Linux Trusty": {"port_name": "linux-trusty", "specifiers": [ 'Trusty', 'Release']},
60 "WebKit Linux (dbg)": {"port_name": "linux-precise", "specifiers": [ 'Precise', 'Debug']},
61 "WebKit Mac10.9": {"port_name": "mac-mac10.9", "specifiers": ['Mac10 .9', 'Release']},
62 "WebKit Mac10.10": {"port_name": "mac-mac10.10", "specifiers": ['Mac 10.10', 'Release']},
63 "WebKit Mac10.11": {"port_name": "mac-mac10.11", "specifiers": ['10. 11', 'Release']},
64 "WebKit Mac10.11 (dbg)": {"port_name": "mac-mac10.11", "specifiers": ['10.11', 'Debug']},
65 "WebKit Mac10.11 (retina)": {"port_name": "mac-retina", "specifiers" : ['Retina', 'Release']},
66 "WebKit Android (Nexus4)": {"port_name": "android", "specifiers": [' Android', 'Release']},
67 }
68
69 self._ports_without_builders = [
70 ]
71
72 def builder_path_from_name(self, builder_name):
73 return re.sub(r'[\s().]', '_', builder_name)
74
75 def all_builder_names(self):
76 return sorted(set(self._exact_matches.keys()))
77
78 def all_port_names(self):
79 return sorted(set(map(lambda x: x["port_name"], self._exact_matches.valu es()) + self._ports_without_builders))
80
81 def rebaseline_override_dir(self, builder_name):
82 return self._exact_matches[builder_name].get("rebaseline_override_dir", None)
83
84 def port_name_for_builder_name(self, builder_name):
85 return self._exact_matches[builder_name]["port_name"]
86
87 def specifiers_for_builder(self, builder_name):
88 return self._exact_matches[builder_name]["specifiers"]
89
90 def builder_name_for_port_name(self, target_port_name):
91 debug_builder_name = None
92 for builder_name, builder_info in self._exact_matches.items():
93 if builder_info['port_name'] == target_port_name:
94 if 'dbg' in builder_name:
95 debug_builder_name = builder_name
96 else:
97 return builder_name
98 return debug_builder_name
99
100 def builder_path_for_port_name(self, port_name):
101 self.builder_path_from_name(self.builder_name_for_port_name(port_name))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698