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

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

Issue 2019923002: Fix pylint unused-* warnings in webkitpy/tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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
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
(...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 import logging 29 import logging
30 30
31 from webkitpy.common.net import sheriff_calendar
32 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
33 from webkitpy.layout_tests.models.test_expectations import TestExpectationParser
34 from webkitpy.layout_tests.models.test_expectations import TestExpectations 32 from webkitpy.layout_tests.models.test_expectations import TestExpectations
35 from webkitpy.layout_tests.models.test_expectations import TestExpectationsModel 33 from webkitpy.layout_tests.models.test_expectations import TestExpectationsModel
36 from webkitpy.tool.commands.command import Command 34 from webkitpy.tool.commands.command import Command
37 35
38 36
39 _log = logging.getLogger(__name__) 37 _log = logging.getLogger(__name__)
40 38
41 39
42 class FlakyTests(Command): 40 class FlakyTests(Command):
43 name = "print-flaky-tests" 41 name = "print-flaky-tests"
(...skipping 24 matching lines...) Expand all
68 self.expectations_factory = BotTestExpectationsFactory 66 self.expectations_factory = BotTestExpectationsFactory
69 67
70 def _filter_build_type_specifiers(self, specifiers): 68 def _filter_build_type_specifiers(self, specifiers):
71 filtered = [] 69 filtered = []
72 for specifier in specifiers: 70 for specifier in specifiers:
73 if specifier.lower() not in TestExpectations.BUILD_TYPES: 71 if specifier.lower() not in TestExpectations.BUILD_TYPES:
74 filtered.append(specifier) 72 filtered.append(specifier)
75 return filtered 73 return filtered
76 74
77 def _collect_expectation_lines(self, builder_names, factory): 75 def _collect_expectation_lines(self, builder_names, factory):
78 all_lines = []
79
80 models = [] 76 models = []
81 for builder_name in builder_names: 77 for builder_name in builder_names:
82 model = TestExpectationsModel() 78 model = TestExpectationsModel()
83 models.append(model) 79 models.append(model)
84 80
85 expectations = factory.expectations_for_builder(builder_name) 81 expectations = factory.expectations_for_builder(builder_name)
86 82
87 # TODO(ojan): We should also skip bots that haven't uploaded recentl y, 83 # TODO(ojan): We should also skip bots that haven't uploaded recentl y,
88 # e.g. if they're >24h stale. 84 # e.g. if they're >24h stale.
89 if not expectations: 85 if not expectations:
(...skipping 25 matching lines...) Expand all
115 # Skip any tests which are mentioned in the dashboard but not in our che ckout: 111 # Skip any tests which are mentioned in the dashboard but not in our che ckout:
116 fs = tool.filesystem 112 fs = tool.filesystem
117 lines = filter(lambda line: fs.exists(fs.join(port.layout_tests_dir(), l ine.path)), lines) 113 lines = filter(lambda line: fs.exists(fs.join(port.layout_tests_dir(), l ine.path)), lines)
118 114
119 test_names = [line.name for line in lines] 115 test_names = [line.name for line in lines]
120 flakiness_dashboard_url = self.FLAKINESS_DASHBOARD_URL % ','.join(test_n ames) 116 flakiness_dashboard_url = self.FLAKINESS_DASHBOARD_URL % ','.join(test_n ames)
121 expectations_string = TestExpectations.list_to_string(lines) 117 expectations_string = TestExpectations.list_to_string(lines)
122 118
123 # pylint: disable=E1601 119 # pylint: disable=E1601
124 print self.OUTPUT % (self.HEADER, expectations_string, flakiness_dashboa rd_url) 120 print self.OUTPUT % (self.HEADER, expectations_string, flakiness_dashboa rd_url)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698