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

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

Issue 12913002: Android: Filter browsertests with MANUAL_ and PRE_ prefix. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed method Created 7 years, 9 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/filter/content_browsertests_disabled » ('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 5d2f48d45e56cd2006e0e840b75d52938425b737..7e4e16cb5520878d9114e1e456f43731c723ea84 100644
--- a/build/android/pylib/browsertests/dispatch.py
+++ b/build/android/pylib/browsertests/dispatch.py
@@ -55,8 +55,9 @@ def Dispatch(options):
if options.gtest_filter:
all_tests = [t for t in options.gtest_filter.split(':') if t]
else:
- all_tests = gtest_dispatch.GetAllEnabledTests(RunnerFactory,
- attached_devices)
+ all_enabled = gtest_dispatch.GetAllEnabledTests(RunnerFactory,
+ attached_devices)
+ all_tests = _FilterTests(all_enabled)
# Run tests.
test_results = shard.ShardAndRunTests(RunnerFactory, attached_devices,
@@ -67,3 +68,18 @@ def Dispatch(options):
build_type=options.build_type,
flakiness_server=options.flakiness_dashboard_server)
test_results.PrintAnnotation()
+
+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/filter/content_browsertests_disabled » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698