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

Unified Diff: build/android/pylib/browsertests/dispatch.py

Issue 19479002: [Android] Clean up gtest filtering logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed all comments Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | build/android/pylib/gtest/dispatch.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/browsertests/dispatch.py
diff --git a/build/android/pylib/browsertests/dispatch.py b/build/android/pylib/browsertests/dispatch.py
index dcd864882dca0e1c44d18e321c76c34bf62b13c7..28ee318ddf89e9f53162bcbb0f3fae7740ccd90f 100644
--- a/build/android/pylib/browsertests/dispatch.py
+++ b/build/android/pylib/browsertests/dispatch.py
@@ -19,10 +19,6 @@ from pylib.gtest import dispatch as gtest_dispatch
from pylib.gtest import test_runner
from pylib.utils import report_results
-sys.path.insert(0,
- os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib'))
-from common import unittest_util
-
def Dispatch(options):
"""Dispatches all content_browsertests.
@@ -75,21 +71,16 @@ def Dispatch(options):
constants.BROWSERTEST_TEST_ACTIVITY_NAME,
constants.BROWSERTEST_COMMAND_LINE_FILE)
- # Get tests and split them up based on the number of devices.
- all_enabled = gtest_dispatch.GetAllEnabledTests(RunnerFactory,
- attached_devices)
- if options.test_filter:
- all_tests = unittest_util.FilterTestNames(all_enabled,
- options.test_filter)
- else:
- all_tests = _FilterTests(all_enabled)
+ tests = gtest_dispatch.GetTestsFiltered(
+ constants.BROWSERTEST_SUITE_NAME, options.test_filter, RunnerFactory,
+ attached_devices)
# Run tests.
# TODO(nileshagrawal): remove this abnormally long setup timeout once fewer
# files are pushed to the devices for content_browsertests: crbug.com/138275
setup_timeout = 20 * 60 # 20 minutes
test_results, exit_code = shard.ShardAndRunTests(
- RunnerFactory, attached_devices, all_tests, options.build_type,
+ RunnerFactory, attached_devices, tests, options.build_type,
setup_timeout=setup_timeout, test_timeout=None,
num_retries=options.num_retries)
report_results.LogFull(
@@ -103,21 +94,3 @@ def Dispatch(options):
shutil.rmtree(constants.ISOLATE_DEPS_DIR)
return (test_results, exit_code)
-
-
-def _FilterTests(all_enabled_tests):
- """Filters out tests and fixtures starting with PRE_ and MANUAL_."""
- return [t for t in all_enabled_tests if _ShouldRunOnBot(t)]
-
-
-def _ShouldRunOnBot(test):
- fixture, case = test.split('.', 1)
- if _StartsWith(fixture, case, 'PRE_'):
- return False
- if _StartsWith(fixture, case, 'MANUAL_'):
- return False
- return True
-
-
-def _StartsWith(a, b, prefix):
- return a.startswith(prefix) or b.startswith(prefix)
« no previous file with comments | « no previous file | build/android/pylib/gtest/dispatch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698