| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Runs perf tests. | 5 """Runs perf tests. |
| 6 | 6 |
| 7 Our buildbot infrastructure requires each slave to run steps serially. | 7 Our buildbot infrastructure requires each slave to run steps serially. |
| 8 This is sub-optimal for android, where these steps can run independently on | 8 This is sub-optimal for android, where these steps can run independently on |
| 9 multiple connected devices. | 9 multiple connected devices. |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 from pylib import constants | 62 from pylib import constants |
| 63 from pylib import forwarder | 63 from pylib import forwarder |
| 64 from pylib.base import base_test_result | 64 from pylib.base import base_test_result |
| 65 from pylib.base import base_test_runner | 65 from pylib.base import base_test_runner |
| 66 from pylib.device import device_errors | 66 from pylib.device import device_errors |
| 67 | 67 |
| 68 | 68 |
| 69 def OutputJsonList(json_input, json_output): | 69 def OutputJsonList(json_input, json_output): |
| 70 with file(json_input, 'r') as i: | 70 with file(json_input, 'r') as i: |
| 71 all_steps = json.load(i) | 71 all_steps = json.load(i) |
| 72 step_names = all_steps['steps'].keys() | 72 step_values = [{'test': k, 'device_affinity': v['device_affinity']} |
| 73 for k, v in all_steps['steps'].iteritems()] |
| 73 with file(json_output, 'w') as o: | 74 with file(json_output, 'w') as o: |
| 74 o.write(json.dumps(step_names)) | 75 o.write(json.dumps(step_values)) |
| 75 return 0 | 76 return 0 |
| 76 | 77 |
| 77 | 78 |
| 78 def PrintTestOutput(test_name, json_file_name=None): | 79 def PrintTestOutput(test_name, json_file_name=None): |
| 79 """Helper method to print the output of previously executed test_name. | 80 """Helper method to print the output of previously executed test_name. |
| 80 | 81 |
| 81 Args: | 82 Args: |
| 82 test_name: name of the test that has been previously executed. | 83 test_name: name of the test that has been previously executed. |
| 83 json_file_name: name of the file to output chartjson data to. | 84 json_file_name: name of the file to output chartjson data to. |
| 84 | 85 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 Returns: | 328 Returns: |
| 328 A tuple of (TestRunResults, retry). | 329 A tuple of (TestRunResults, retry). |
| 329 """ | 330 """ |
| 330 _, result_type = self._LaunchPerfTest(test_name) | 331 _, result_type = self._LaunchPerfTest(test_name) |
| 331 results = base_test_result.TestRunResults() | 332 results = base_test_result.TestRunResults() |
| 332 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) | 333 results.AddResult(base_test_result.BaseTestResult(test_name, result_type)) |
| 333 retry = None | 334 retry = None |
| 334 if not results.DidRunPass(): | 335 if not results.DidRunPass(): |
| 335 retry = test_name | 336 retry = test_name |
| 336 return results, retry | 337 return results, retry |
| OLD | NEW |