summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py')
-rw-r--r--chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py36
1 files changed, 27 insertions, 9 deletions
diff --git a/chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py b/chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
index 4782c1aea5f..9b0f5d5dee3 100644
--- a/chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
+++ b/chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/layout_package/bot_test_expectations.py
@@ -110,41 +110,59 @@ class BotTestExpectationsFactory(object):
def _results_json_for_port(self, port_name, builder_category):
if builder_category == 'deps':
- builder_name = builders.deps_builder_name_for_port_name(port_name)
+ builder = builders.deps_builder_name_for_port_name(port_name)
else:
- builder_name = builders.builder_name_for_port_name(port_name)
+ builder = builders.builder_name_for_port_name(port_name)
- if not builder_name:
+ if not builder:
return None
- results_url = self.RESULTS_URL_PREFIX + urllib.quote(builder_name)
+ return self._results_json_for_builder(builder)
+
+ def _results_json_for_builder(self, builder):
+ results_url = self.RESULTS_URL_PREFIX + urllib.quote(builder)
try:
_log.debug('Fetching flakiness data from appengine.')
- return ResultsJSON(builder_name, json.load(urllib2.urlopen(results_url)))
+ return ResultsJSON(builder, json.load(urllib2.urlopen(results_url)))
except urllib2.URLError as error:
_log.warning('Could not retrieve flakiness data from the bot. url: %s', results_url)
_log.warning(error)
def expectations_for_port(self, port_name, builder_category='layout'):
+ # FIXME: This only grabs release builder's flakiness data. If we're running debug,
+ # when we should grab the debug builder's data.
+ # FIXME: What should this do if there is no debug builder for a port, e.g. we have
+ # no debug XP builder? Should it use the release bot or another Windows debug bot?
+ # At the very least, it should log an error.
results_json = self._results_json_for_port(port_name, builder_category)
if not results_json:
return None
return BotTestExpectations(results_json)
+ def expectations_for_builder(self, builder):
+ results_json = self._results_json_for_builder(builder)
+ if not results_json:
+ return None
+ return BotTestExpectations(results_json)
class BotTestExpectations(object):
# FIXME: Get this from the json instead of hard-coding it.
RESULT_TYPES_TO_IGNORE = ['N', 'X', 'Y']
- def __init__(self, results_json):
+ # specifiers arg is used in unittests to avoid the static dependency on builders.
+ def __init__(self, results_json, specifiers=None):
self.results_json = results_json
+ self.specifiers = specifiers or set(builders.specifiers_for_builder(results_json.builder_name))
def _line_from_test_and_flaky_types_and_bug_urls(self, test_path, flaky_types, bug_urls):
line = TestExpectationLine()
line.original_string = test_path
line.name = test_path
line.filename = test_path
- line.specifiers = bug_urls if bug_urls else ""
+ line.path = test_path # FIXME: Should this be normpath?
+ line.matching_tests = [test_path]
+ line.bugs = bug_urls if bug_urls else ["Bug(gardener)"]
line.expectations = sorted(map(self.results_json.expectation_for_type, flaky_types))
+ line.specifiers = self.specifiers
return line
def flakes_by_path(self, only_ignore_very_flaky):
@@ -203,11 +221,11 @@ class BotTestExpectations(object):
unexpected_results_by_path[test_path] = sorted(map(exp_to_string, expectations))
return unexpected_results_by_path
- def expectation_lines(self):
+ def expectation_lines(self, only_ignore_very_flaky=False):
lines = []
for test_path, entry in self.results_json.walk_results():
results_array = entry[self.results_json.RESULTS_KEY]
- flaky_types = self._flaky_types_in_results(results_array, False)
+ flaky_types = self._flaky_types_in_results(results_array, only_ignore_very_flaky)
if len(flaky_types) > 1:
bug_urls = entry.get(self.results_json.BUGS_KEY)
line = self._line_from_test_and_flaky_types_and_bug_urls(test_path, flaky_types, bug_urls)