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

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: 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..998916a692a5c201ed031e759d050dba5e355639 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 _ValidTest(t)]
+
+def _ValidTest(test):
Yaron 2013/03/18 20:41:31 Instead of "Valid", call "Automatable"/Bot?
nilesh 2013/03/18 22:02:47 Renamed to _ShouldRunOnBot
+ 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