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

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

Issue 2341173002: Move tokenize_line method from TestExpectationParser to TestExpectationLine. (Closed)
Patch Set: Created 4 years, 3 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
1 # Copyright (C) 2012 Google Inc. All rights reserved. 1 # Copyright (C) 2012 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 10 matching lines...) Expand all
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 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. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 29
30 from webkitpy.layout_tests.models import test_expectations 30 from webkitpy.layout_tests.models import test_expectations
31 from webkitpy.layout_tests.models.test_expectations import TestExpectations, Tes tExpectationLine
31 32
32 from webkitpy.common.net.layouttestresults import LayoutTestResults 33 from webkitpy.common.net.layouttestresults import LayoutTestResults
33 34
34 35
35 TestExpectations = test_expectations.TestExpectations
36 TestExpectationParser = test_expectations.TestExpectationParser
37
38
39 class BuildBotPrinter(object): 36 class BuildBotPrinter(object):
40 # This output is parsed by buildbots and must only be changed in coordinatio n with buildbot scripts (see webkit.org's 37 # This output is parsed by buildbots and must only be changed in coordinatio n with buildbot scripts (see webkit.org's
41 # Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg: RunWebKitTests ._parseNewRunWebKitTestsOutput 38 # Tools/BuildSlaveSupport/build.webkit.org-config/master.cfg: RunWebKitTests ._parseNewRunWebKitTestsOutput
42 # and chromium.org's buildbot/master.chromium/scripts/master/log_parser/webk it_test_command.py). 39 # and chromium.org's buildbot/master.chromium/scripts/master/log_parser/webk it_test_command.py).
43 40
44 def __init__(self, stream, debug_logging): 41 def __init__(self, stream, debug_logging):
45 self.stream = stream 42 self.stream = stream
46 self.debug_logging = debug_logging 43 self.debug_logging = debug_logging
47 44
48 def print_results(self, run_details): 45 def print_results(self, run_details):
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 for key, tests in flaky.iteritems(): 135 for key, tests in flaky.iteritems():
139 result_type = TestExpectations.EXPECTATIONS[key.lower()] 136 result_type = TestExpectations.EXPECTATIONS[key.lower()]
140 self._print("Unexpected flakiness: %s (%d)" % (descriptions[resu lt_type], len(tests))) 137 self._print("Unexpected flakiness: %s (%d)" % (descriptions[resu lt_type], len(tests)))
141 tests.sort() 138 tests.sort()
142 139
143 for test in tests: 140 for test in tests:
144 result = test_results.result_for_test(test) 141 result = test_results.result_for_test(test)
145 actual = result.actual_results().split(" ") 142 actual = result.actual_results().split(" ")
146 expected = result.expected_results().split(" ") 143 expected = result.expected_results().split(" ")
147 # FIXME: clean this up once the old syntax is gone 144 # FIXME: clean this up once the old syntax is gone
148 new_expectations_list = [TestExpectationParser._inverted_exp ectation_tokens[exp] 145 new_expectations_list = [TestExpectationLine.inverted_expect ation_tokens[exp]
149 for exp in list(set(actual) | set(e xpected))] 146 for exp in list(set(actual) | set(e xpected))]
150 self._print(" %s [ %s ]" % (test, " ".join(new_expectations _list))) 147 self._print(" %s [ %s ]" % (test, " ".join(new_expectations _list)))
151 self._print("") 148 self._print("")
152 self._print("") 149 self._print("")
153 150
154 if len(regressions): 151 if len(regressions):
155 descriptions = TestExpectations.EXPECTATION_DESCRIPTIONS 152 descriptions = TestExpectations.EXPECTATION_DESCRIPTIONS
156 for key, tests in regressions.iteritems(): 153 for key, tests in regressions.iteritems():
157 result_type = TestExpectations.EXPECTATIONS[key.lower()] 154 result_type = TestExpectations.EXPECTATIONS[key.lower()]
158 self._print("Regressions: Unexpected %s (%d)" % (descriptions[re sult_type], len(tests))) 155 self._print("Regressions: Unexpected %s (%d)" % (descriptions[re sult_type], len(tests)))
159 tests.sort() 156 tests.sort()
160 for test in tests: 157 for test in tests:
161 result = test_results.result_for_test(test) 158 result = test_results.result_for_test(test)
162 actual = result.actual_results().split(" ") 159 actual = result.actual_results().split(" ")
163 expected = result.expected_results().split(" ") 160 expected = result.expected_results().split(" ")
164 new_expectations_list = [TestExpectationParser._inverted_exp ectation_tokens[exp] for exp in actual] 161 new_expectations_list = [TestExpectationLine.inverted_expect ation_tokens[exp] for exp in actual]
165 self._print(" %s [ %s ]" % (test, " ".join(new_expectations _list))) 162 self._print(" %s [ %s ]" % (test, " ".join(new_expectations _list)))
166 self._print("") 163 self._print("")
167 164
168 if len(summarized_results['tests']) and self.debug_logging: 165 if len(summarized_results['tests']) and self.debug_logging:
169 self._print("%s" % ("-" * 78)) 166 self._print("%s" % ("-" * 78))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698