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

Side by Side Diff: build/android/pylib/browsertests/dispatch.py

Issue 15942016: Creates a new test running script test_runner.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Several more fixes Created 7 years, 6 months 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 (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 import sys 7 import sys
8 8
9 from pylib import android_commands 9 from pylib import android_commands
10 from pylib import cmd_helper 10 from pylib import cmd_helper
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 options.build_type, 54 options.build_type,
55 options.webkit, 55 options.webkit,
56 options.push_deps, 56 options.push_deps,
57 constants.BROWSERTEST_TEST_PACKAGE_NAME, 57 constants.BROWSERTEST_TEST_PACKAGE_NAME,
58 constants.BROWSERTEST_TEST_ACTIVITY_NAME, 58 constants.BROWSERTEST_TEST_ACTIVITY_NAME,
59 constants.BROWSERTEST_COMMAND_LINE_FILE) 59 constants.BROWSERTEST_COMMAND_LINE_FILE)
60 60
61 # Get tests and split them up based on the number of devices. 61 # Get tests and split them up based on the number of devices.
62 all_enabled = gtest_dispatch.GetAllEnabledTests(RunnerFactory, 62 all_enabled = gtest_dispatch.GetAllEnabledTests(RunnerFactory,
63 attached_devices) 63 attached_devices)
64 if options.gtest_filter: 64 if options.test_filter:
65 all_tests = unittest_util.FilterTestNames(all_enabled, 65 all_tests = unittest_util.FilterTestNames(all_enabled,
66 options.gtest_filter) 66 options.test_filter)
67 else: 67 else:
68 all_tests = _FilterTests(all_enabled) 68 all_tests = _FilterTests(all_enabled)
69 69
70 # Run tests. 70 # Run tests.
71 # TODO(nileshagrawal): remove this abnormally long setup timeout once fewer 71 # TODO(nileshagrawal): remove this abnormally long setup timeout once fewer
72 # files are pushed to the devices for content_browsertests: crbug.com/138275 72 # files are pushed to the devices for content_browsertests: crbug.com/138275
73 setup_timeout = 20 * 60 # 20 minutes 73 setup_timeout = 20 * 60 # 20 minutes
74 test_results = shard.ShardAndRunTests(RunnerFactory, attached_devices, 74 test_results = shard.ShardAndRunTests(RunnerFactory, attached_devices,
75 all_tests, options.build_type, 75 all_tests, options.build_type,
76 setup_timeout=setup_timeout, 76 setup_timeout=setup_timeout,
77 test_timeout=None, 77 test_timeout=None,
78 num_retries=options.num_retries) 78 num_retries=options.num_retries)
79 report_results.LogFull( 79 report_results.LogFull(
80 results=test_results, 80 results=test_results,
81 test_type='Unit test', 81 test_type='Unit test',
82 test_package=constants.BROWSERTEST_SUITE_NAME, 82 test_package=constants.BROWSERTEST_SUITE_NAME,
83 build_type=options.build_type, 83 build_type=options.build_type,
84 flakiness_server=options.flakiness_dashboard_server) 84 flakiness_server=options.flakiness_dashboard_server)
85 report_results.PrintAnnotation(test_results) 85 report_results.PrintAnnotation(test_results)
86 86
87 return len(test_results.GetNotPass())
88
87 def _FilterTests(all_enabled_tests): 89 def _FilterTests(all_enabled_tests):
88 """Filters out tests and fixtures starting with PRE_ and MANUAL_.""" 90 """Filters out tests and fixtures starting with PRE_ and MANUAL_."""
89 return [t for t in all_enabled_tests if _ShouldRunOnBot(t)] 91 return [t for t in all_enabled_tests if _ShouldRunOnBot(t)]
90 92
91 def _ShouldRunOnBot(test): 93 def _ShouldRunOnBot(test):
92 fixture, case = test.split('.', 1) 94 fixture, case = test.split('.', 1)
93 if _StartsWith(fixture, case, "PRE_"): 95 if _StartsWith(fixture, case, "PRE_"):
94 return False 96 return False
95 if _StartsWith(fixture, case, "MANUAL_"): 97 if _StartsWith(fixture, case, "MANUAL_"):
96 return False 98 return False
97 return True 99 return True
98 100
99 def _StartsWith(a, b, prefix): 101 def _StartsWith(a, b, prefix):
100 return a.startswith(prefix) or b.startswith(prefix) 102 return a.startswith(prefix) or b.startswith(prefix)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698