Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
| 9 from . import perf_test | 9 from . import perf_test |
| 10 | 10 |
| 11 BUCKET = 'chrome-perf' | 11 BUCKET = 'chrome-perf' |
| 12 RESULTS_GS_DIR = 'bisect-results' | 12 RESULTS_GS_DIR = 'bisect-results' |
| 13 | 13 |
| 14 | 14 |
| 15 class BisectTesterApi(recipe_api.RecipeApi): | 15 class BisectTesterApi(recipe_api.RecipeApi): |
| 16 """A module for the bisect tester bot using the chromium recipe.""" | 16 """A module for the bisect tester bot using the chromium recipe.""" |
| 17 | 17 |
| 18 def __init__(self, **kwargs): | 18 def __init__(self, **kwargs): |
| 19 super(BisectTesterApi, self).__init__(**kwargs) | 19 super(BisectTesterApi, self).__init__(**kwargs) |
| 20 self.device_to_test = None | |
|
dtu
2016/07/06 21:14:09
Call me an OOP purist, but I dislike having public
Ziqi Xiong
2016/07/07 01:44:24
See new issue: https://codereview.chromium.org/211
| |
| 21 self.devices_tested = [] | |
| 20 | 22 |
| 21 def local_test_enabled(self): | 23 def local_test_enabled(self): |
| 22 buildername = os.environ.get('BUILDBOT_BUILDERNAME') | 24 buildername = os.environ.get('BUILDBOT_BUILDERNAME') |
| 23 cr_config = self.m.chromium.c | 25 cr_config = self.m.chromium.c |
| 24 if buildername and buildername.endswith('_bisect') and cr_config: | 26 if buildername and buildername.endswith('_bisect') and cr_config: |
| 25 return True # pragma: no cover | 27 return True # pragma: no cover |
| 26 return False | 28 return False |
| 27 | 29 |
| 28 def load_config_from_dict(self, bisect_config): | 30 def load_config_from_dict(self, bisect_config): |
| 29 """Copies the required configuration keys to a new dict.""" | 31 """Copies the required configuration keys to a new dict.""" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 self.m.properties['mastername'], | 85 self.m.properties['mastername'], |
| 84 self.m.properties['buildername'], | 86 self.m.properties['buildername'], |
| 85 self.m.properties['buildnumber']) | 87 self.m.properties['buildnumber']) |
| 86 local_save_results = self.m.python('saving url to temp file', | 88 local_save_results = self.m.python('saving url to temp file', |
| 87 self.resource('put_temp.py'), | 89 self.resource('put_temp.py'), |
| 88 stdout=self.m.raw_io.output(), | 90 stdout=self.m.raw_io.output(), |
| 89 stdin=self.m.raw_io.input(url)) | 91 stdin=self.m.raw_io.input(url)) |
| 90 local_file = local_save_results.stdout.splitlines()[0].strip() | 92 local_file = local_save_results.stdout.splitlines()[0].strip() |
| 91 self.m.gsutil.upload( | 93 self.m.gsutil.upload( |
| 92 local_file, BUCKET, gs_filename, name=str(gs_filename)) | 94 local_file, BUCKET, gs_filename, name=str(gs_filename)) |
| OLD | NEW |