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

Side by Side Diff: scripts/slave/recipe_modules/json/util.py

Issue 674023002: Fix name/path separator for telemetry_unittests test names. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: fix --no-find-copies Created 6 years, 2 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
« no previous file with comments | « scripts/slave/recipe_modules/json/test_api.py ('k') | scripts/slave/recipes/chromium_trybot.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 def convert_trie_to_flat_paths(trie, prefix=None): 1 def convert_trie_to_flat_paths(trie, prefix, sep):
2 # Cloned from webkitpy.layout_tests.layout_package.json_results_generator 2 # Cloned from webkitpy.layout_tests.layout_package.json_results_generator
3 # so that this code can stand alone. 3 # so that this code can stand alone.
4 result = {} 4 result = {}
5 for name, data in trie.iteritems(): 5 for name, data in trie.iteritems():
6 if prefix: 6 if prefix:
7 name = prefix + "/" + name 7 name = prefix + sep + name
8 8
9 if len(data) and not "actual" in data and not "expected" in data: 9 if len(data) and not "actual" in data and not "expected" in data:
10 result.update(convert_trie_to_flat_paths(data, name)) 10 result.update(convert_trie_to_flat_paths(data, name, sep))
11 else: 11 else:
12 result[name] = data 12 result[name] = data
13 13
14 return result 14 return result
15 15
16 16
17 # TODO(phajdan.jr): Rename to LayoutTestResults.
18 class TestResults(object): 17 class TestResults(object):
19 def __init__(self, jsonish=None): 18 def __init__(self, jsonish=None):
20 self.raw = jsonish or {} 19 self.raw = jsonish or {}
21 self.valid = (jsonish is not None) 20 self.valid = (jsonish is not None)
22 21
23 self.tests = convert_trie_to_flat_paths(self.raw.get('tests', {})) 22 tests = self.raw.get('tests', {})
23 sep = self.raw.get('path_delimiter', '/')
24 self.tests = convert_trie_to_flat_paths(tests, prefix=None, sep=sep)
25
24 self.passes = {} 26 self.passes = {}
25 self.unexpected_passes = {} 27 self.unexpected_passes = {}
26 self.failures = {} 28 self.failures = {}
27 self.unexpected_failures = {} 29 self.unexpected_failures = {}
28 self.flakes = {} 30 self.flakes = {}
29 self.unexpected_flakes = {} 31 self.unexpected_flakes = {}
30 32
31 # TODO(dpranke): crbug.com/357866 - we should simplify the handling of 33 # TODO(dpranke): crbug.com/357866 - we should simplify the handling of
32 # both the return code and parsing the actual results, below. 34 # both the return code and parsing the actual results, below.
33 35
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 else: 120 else:
119 self.failures.add(test_fullname) 121 self.failures.add(test_fullname)
120 122
121 # With multiple iterations a test could have passed in one but failed 123 # With multiple iterations a test could have passed in one but failed
122 # in another. Remove tests that ever failed from the passing set. 124 # in another. Remove tests that ever failed from the passing set.
123 self.passes -= self.failures 125 self.passes -= self.failures
124 126
125 def as_jsonish(self): 127 def as_jsonish(self):
126 ret = self.raw.copy() 128 ret = self.raw.copy()
127 return ret 129 return ret
OLDNEW
« no previous file with comments | « scripts/slave/recipe_modules/json/test_api.py ('k') | scripts/slave/recipes/chromium_trybot.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698