| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 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 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 | 7 |
| 8 from pylib import android_commands | 8 from pylib import android_commands |
| 9 from pylib import cmd_helper | 9 from pylib import cmd_helper |
| 10 from pylib import constants | 10 from pylib import constants |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 attached_devices) | 61 attached_devices) |
| 62 all_tests = _FilterTests(all_enabled) | 62 all_tests = _FilterTests(all_enabled) |
| 63 | 63 |
| 64 # Run tests. | 64 # Run tests. |
| 65 # TODO(nileshagrawal): remove this abnormally long setup timeout once fewer | 65 # TODO(nileshagrawal): remove this abnormally long setup timeout once fewer |
| 66 # files are pushed to the devices for content_browsertests: crbug.com/138275 | 66 # files are pushed to the devices for content_browsertests: crbug.com/138275 |
| 67 setup_timeout = 20 * 60 # 20 minutes | 67 setup_timeout = 20 * 60 # 20 minutes |
| 68 test_results = shard.ShardAndRunTests(RunnerFactory, attached_devices, | 68 test_results = shard.ShardAndRunTests(RunnerFactory, attached_devices, |
| 69 all_tests, options.build_type, | 69 all_tests, options.build_type, |
| 70 setup_timeout=setup_timeout, | 70 setup_timeout=setup_timeout, |
| 71 test_timeout=None) | 71 test_timeout=None, |
| 72 num_retries=options.num_retries) |
| 72 report_results.LogFull( | 73 report_results.LogFull( |
| 73 results=test_results, | 74 results=test_results, |
| 74 test_type='Unit test', | 75 test_type='Unit test', |
| 75 test_package=constants.BROWSERTEST_SUITE_NAME, | 76 test_package=constants.BROWSERTEST_SUITE_NAME, |
| 76 build_type=options.build_type, | 77 build_type=options.build_type, |
| 77 flakiness_server=options.flakiness_dashboard_server) | 78 flakiness_server=options.flakiness_dashboard_server) |
| 78 report_results.PrintAnnotation(test_results) | 79 report_results.PrintAnnotation(test_results) |
| 79 | 80 |
| 80 def _FilterTests(all_enabled_tests): | 81 def _FilterTests(all_enabled_tests): |
| 81 """Filters out tests and fixtures starting with PRE_ and MANUAL_.""" | 82 """Filters out tests and fixtures starting with PRE_ and MANUAL_.""" |
| 82 return [t for t in all_enabled_tests if _ShouldRunOnBot(t)] | 83 return [t for t in all_enabled_tests if _ShouldRunOnBot(t)] |
| 83 | 84 |
| 84 def _ShouldRunOnBot(test): | 85 def _ShouldRunOnBot(test): |
| 85 fixture, case = test.split('.', 1) | 86 fixture, case = test.split('.', 1) |
| 86 if _StartsWith(fixture, case, "PRE_"): | 87 if _StartsWith(fixture, case, "PRE_"): |
| 87 return False | 88 return False |
| 88 if _StartsWith(fixture, case, "MANUAL_"): | 89 if _StartsWith(fixture, case, "MANUAL_"): |
| 89 return False | 90 return False |
| 90 return True | 91 return True |
| 91 | 92 |
| 92 def _StartsWith(a, b, prefix): | 93 def _StartsWith(a, b, prefix): |
| 93 return a.startswith(prefix) or b.startswith(prefix) | 94 return a.startswith(prefix) or b.startswith(prefix) |
| OLD | NEW |