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

Side by Side Diff: appengine/findit/waterfall/flake/step_mapper.py

Issue 2557553002: [Culprit-Finder] Seperate gae related part in cache_decorator and gitile repository to gae_libs/ (Closed)
Patch Set: Created 4 years 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 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import json 5 import json
6 import os 6 import os
7 7
8 import logging 8 import logging
9 9
10 from common.http_client_appengine import HttpClientAppengine as HttpClient 10 from common.http_client_appengine import HttpClientAppengine as HttpClient
11 from gae_libs import caches
11 from lib import cache_decorator 12 from lib import cache_decorator
12 from waterfall import buildbot 13 from waterfall import buildbot
13 from waterfall import swarming_util 14 from waterfall import swarming_util
14 15
15 16
16 @cache_decorator.Cached( 17 @cache_decorator.Cached(
17 namespace='trybots', cacher=cache_decorator.CompressedMemCacher()) 18 namespace='trybots', cache=caches.CompressedMemCache())
18 def _LoadTrybots(): # pragma: no cover. 19 def _LoadTrybots(): # pragma: no cover.
19 """Returns the mapping of Commit Queue trybots to Waterfall buildbots.""" 20 """Returns the mapping of Commit Queue trybots to Waterfall buildbots."""
20 with open(os.path.join(os.path.dirname(__file__), 'trybots.json'), 'r') as f: 21 with open(os.path.join(os.path.dirname(__file__), 'trybots.json'), 'r') as f:
21 return json.load(f) 22 return json.load(f)
22 23
23 24
24 def _GetMatchingBuildbots(cq_master_name, cq_builder_name): # pragma: no cover. 25 def _GetMatchingBuildbots(cq_master_name, cq_builder_name): # pragma: no cover.
25 """Returns a list of matching builder/tester buildbots on Waterfall.""" 26 """Returns a list of matching builder/tester buildbots on Waterfall."""
26 trybot_map = _LoadTrybots() 27 trybot_map = _LoadTrybots()
27 builders = trybot_map.get(cq_master_name, {}).get('builders', {}) 28 builders = trybot_map.get(cq_master_name, {}).get('builders', {})
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 # Retrieve a sample output from Isolate. 161 # Retrieve a sample output from Isolate.
161 output = swarming_util.RetrieveShardedTestResultsFromIsolatedServer( 162 output = swarming_util.RetrieveShardedTestResultsFromIsolatedServer(
162 step_isolated_data[:1], http_client) 163 step_isolated_data[:1], http_client)
163 if output: 164 if output:
164 # Guess from the format. 165 # Guess from the format.
165 build_step.supported = ( 166 build_step.supported = (
166 isinstance(output, dict) and 167 isinstance(output, dict) and
167 isinstance(output.get('all_tests'), list) and 168 isinstance(output.get('all_tests'), list) and
168 isinstance(output.get('per_iteration_data'), list) and 169 isinstance(output.get('per_iteration_data'), list) and
169 all(isinstance(i, dict) for i in output.get('per_iteration_data')) 170 all(isinstance(i, dict) for i in output.get('per_iteration_data'))
170 ) 171 )
wrengr 2016/12/06 21:52:57 not sure what Rietveld is trying to say the change
Sharu Jiang 2016/12/06 23:58:17 it's removing the newline at the end.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698