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

Unified 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: Reverts flakiness server change, uses os.path.join 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/adb_install_apk.py ('k') | 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 ce1bc5acc4be1dbf732a5d86136ae40be2e3051d..8457cf2f618986b8f1bad9770d3273bf9eabf35a 100644
--- a/build/android/pylib/browsertests/dispatch.py
+++ b/build/android/pylib/browsertests/dispatch.py
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+"""Dispatches content_browsertests."""
+
import logging
import os
import sys
@@ -17,10 +19,12 @@ 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."""
+
attached_devices = []
if options.test_device:
attached_devices = [options.test_device]
@@ -61,9 +65,9 @@ def Dispatch(options):
# Get tests and split them up based on the number of devices.
all_enabled = gtest_dispatch.GetAllEnabledTests(RunnerFactory,
attached_devices)
- if options.gtest_filter:
+ if options.test_filter:
all_tests = unittest_util.FilterTestNames(all_enabled,
- options.gtest_filter)
+ options.test_filter)
else:
all_tests = _FilterTests(all_enabled)
@@ -84,17 +88,22 @@ def Dispatch(options):
flakiness_server=options.flakiness_dashboard_server)
report_results.PrintAnnotation(test_results)
+ return len(test_results.GetNotPass())
+
+
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_"):
+ if _StartsWith(fixture, case, 'PRE_'):
return False
- if _StartsWith(fixture, case, "MANUAL_"):
+ 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 | « build/android/adb_install_apk.py ('k') | build/android/pylib/gtest/dispatch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698