| OLD | NEW |
| 1 # Copyright 2012 The Chromium Authors. All rights reserved. | 1 # Copyright 2012 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 logging | 5 import logging |
| 6 import unittest | 6 import unittest |
| 7 | 7 |
| 8 from telemetry import decorators | 8 from telemetry import decorators |
| 9 from telemetry.core import browser_finder | 9 from telemetry.core import browser_finder |
| 10 from telemetry.core import browser_options | 10 from telemetry.core import browser_options |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 163 |
| 164 _, result = self.RunOneSuite(possible_browser, args) | 164 _, result = self.RunOneSuite(possible_browser, args) |
| 165 results.append(result) | 165 results.append(result) |
| 166 | 166 |
| 167 failed_tests = json_results.FailedTestNames(result) | 167 failed_tests = json_results.FailedTestNames(result) |
| 168 retry_limit -= 1 | 168 retry_limit -= 1 |
| 169 | 169 |
| 170 full_results = json_results.FullResults(args, test_suite, results) | 170 full_results = json_results.FullResults(args, test_suite, results) |
| 171 json_results.WriteFullResultsIfNecessary(args, full_results) | 171 json_results.WriteFullResultsIfNecessary(args, full_results) |
| 172 | 172 |
| 173 err_occurred, err_str = json_results.UploadFullResultsIfNecessary( |
| 174 args, full_results) |
| 175 if err_occurred: |
| 176 for line in err_str.splitlines(): |
| 177 logging.error(line) |
| 178 return 1 |
| 179 |
| 173 return json_results.ExitCodeFromFullResults(full_results) | 180 return json_results.ExitCodeFromFullResults(full_results) |
| 174 | 181 |
| 175 def RunOneSuite(self, possible_browser, args): | 182 def RunOneSuite(self, possible_browser, args): |
| 176 test_suite = DiscoverTests(config.test_dirs, config.top_level_dir, | 183 test_suite = DiscoverTests(config.test_dirs, config.top_level_dir, |
| 177 possible_browser, args.positional_args, | 184 possible_browser, args.positional_args, |
| 178 args.run_disabled_tests) | 185 args.run_disabled_tests) |
| 179 runner = output_formatter.TestRunner() | 186 runner = output_formatter.TestRunner() |
| 180 result = runner.run(test_suite, config.output_formatters, | 187 result = runner.run(test_suite, config.output_formatters, |
| 181 args.repeat_count, args) | 188 args.repeat_count, args) |
| 182 return test_suite, result | 189 return test_suite, result |
| 183 | 190 |
| 184 @classmethod | 191 @classmethod |
| 185 @RestoreLoggingLevel | 192 @RestoreLoggingLevel |
| 186 def main(cls, args=None): | 193 def main(cls, args=None): |
| 187 return super(RunTestsCommand, cls).main(args) | 194 return super(RunTestsCommand, cls).main(args) |
| OLD | NEW |