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

Side by Side Diff: Tools/Scripts/webkitpy/tool/commands/flakytests.py

Issue 301853003: Make update-flaky-tests to work again and support all bots (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update comments Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2011 Google Inc. All rights reserved. 1 # Copyright (c) 2011 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
11 # in the documentation and/or other materials provided with the 11 # in the documentation and/or other materials provided with the
12 # distribution. 12 # distribution.
13 # * Neither the name of Google Inc. nor the names of its 13 # * Neither the name of Google Inc. nor the names of its
14 # contributors may be used to endorse or promote products derived from 14 # contributors may be used to endorse or promote products derived from
15 # this software without specific prior written permission. 15 # this software without specific prior written permission.
16 # 16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
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 import operator
29 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand 30 from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
30 from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestEx pectationsFactory 31 from webkitpy.layout_tests.layout_package.bot_test_expectations import BotTestEx pectationsFactory
31 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser , TestExpectationsModel, TestExpectations 32 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser , TestExpectationsModel, TestExpectations
32 33
33 34
34 class FlakyTests(AbstractDeclarativeCommand): 35 class FlakyTests(AbstractDeclarativeCommand):
35 name = "flaky-tests" 36 name = "flaky-tests"
36 help_text = "Generate FlakyTests file from the flakiness dashboard" 37 help_text = "Generate FlakyTests file from the flakiness dashboard"
37 show_in_main_help = True 38 show_in_main_help = True
38 39
39 def execute(self, options, args, tool): 40 def execute(self, options, args, tool):
41 fs = tool.filesystem
ojan 2014/05/29 18:51:20 Nit: this is only used in two places on the same l
40 port = tool.port_factory.get() 42 port = tool.port_factory.get()
41 full_port_name = port.determine_full_port_name(tool, options, port.port_ name) 43 current_expectations = TestExpectations(port, model_all_expectations=Tru e)
42 expectations = BotTestExpectationsFactory().expectations_for_port(full_p ort_name) 44 model = TestExpectationsModel()
43 print TestExpectations.list_to_string(expectations.expectation_lines()) 45 port_names = tool.port_factory.all_port_names()
46 # builders.all_builder_names includes an ASAN builder but
47 # those are in a separate TestExpectations file, so skip it.
48 port_names = filter(lambda name: 'ASAN' not in name, port_names)
Dirk Pranke 2014/05/29 18:25:21 Perhaps 'ASAN' shouldn't be in all_builder_names()
ojan 2014/05/29 18:51:20 +1. I should have done this before when I made reb
49 for port_name in port_names:
50 expectations = BotTestExpectationsFactory().expectations_for_port(po rt_name)
51 for line in expectations.expectation_lines():
52 model.add_expectation_line(line)
53 # FIXME: We need an official API to get all the test names or all test l ines.
54 lines = model._test_to_expectation_line.values()
55 lines.sort(key=operator.attrgetter('path'))
Dirk Pranke 2014/05/29 18:25:21 Can you use key=lambda line: line.path or somethin
Dirk Pranke 2014/05/29 21:06:46 I think you missed this comment as well ...
56 # This is a hack, but prevents duplicates with existing TestExpectations
57 # (which would cause lint-test-expectations to fail). A better solution
58 # would be to update 'current_expectations' with the new data and
59 # write out the whole TestExpectations file.
Dirk Pranke 2014/05/29 18:25:21 I don't think we do complain about duplicates acro
ojan 2014/05/29 18:51:20 This is adding to the regular TestExpectations fil
Dirk Pranke 2014/05/29 18:59:56 Oh. Right. I suppose the better question is, why w
ojan 2014/05/29 19:37:04 Yes! This would solve almost all my concerns I bro
60 lines = filter(lambda line: not current_expectations.model().has_test(li ne.name), lines)
61 # Skip any tests which are mentioned in the dashboard but not in our che ckout:
62 lines = filter(lambda line: fs.exists(fs.join(port.layout_tests_dir(), l ine.path)), lines)
63 print TestExpectations.list_to_string(lines)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698