Commit a8fea93f authored by ilevy@chromium.org's avatar ilevy@chromium.org

Move android buildbot steps into buildbot dir

- Move the step creation lines to the parent script.  The biggest
  advantage of this is the full step is properly printed, starting
  with the exact shell line used to run the test suite.

- Rename some steps into c++ style.

BUG=168894
NOTRY=true

Review URL: https://codereview.chromium.org/11817033

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176010 0039d316-1c4b-4281-b951-d872f2087c98
parent ed005b82
...@@ -16,6 +16,7 @@ import sys ...@@ -16,6 +16,7 @@ import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..')) sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from pylib import buildbot_report from pylib import buildbot_report
from pylib import constants from pylib import constants
from pylib.gtest import gtest_config
TESTING = 'BUILDBOT_TESTING' in os.environ TESTING = 'BUILDBOT_TESTING' in os.environ
...@@ -82,21 +83,21 @@ def RunCmd(command, flunk_on_failure=True): ...@@ -82,21 +83,21 @@ def RunCmd(command, flunk_on_failure=True):
return code return code
def RunTestSuites(options, suite): def RunTestSuites(options, suites):
"""Manages an invocation of run_tests.py. """Manages an invocation of run_tests.py.
Args: Args:
options: options object. options: options object.
suite: The suite to pass to run_tests or None to run default suites. suites: List of suites to run.
""" """
args = ['--verbose'] args = ['--verbose']
if suite:
args.extend(['-s', suite])
if options.target == 'Release': if options.target == 'Release':
args.append('--release') args.append('--release')
if options.asan: if options.asan:
args.append('--tool=asan') args.append('--tool=asan')
RunCmd(['build/android/run_tests.py'] + args) for suite in suites:
buildbot_report.PrintNamedStep(suite)
RunCmd(['build/android/run_tests.py', '-s', suite] + args)
def InstallApk(options, test, print_step=False): def InstallApk(options, test, print_step=False):
...@@ -169,6 +170,7 @@ def RunWebkitLayoutTests(options): ...@@ -169,6 +170,7 @@ def RunWebkitLayoutTests(options):
def MainTestWrapper(options): def MainTestWrapper(options):
# Device check and alert emails # Device check and alert emails
buildbot_report.PrintNamedStep('device_status_check')
RunCmd(['build/android/device_status_check.py'], flunk_on_failure=False) RunCmd(['build/android/device_status_check.py'], flunk_on_failure=False)
if options.install: if options.install:
...@@ -184,25 +186,24 @@ def MainTestWrapper(options): ...@@ -184,25 +186,24 @@ def MainTestWrapper(options):
SpawnCmd(['build/android/adb_logcat_monitor.py', logcat_dir]) SpawnCmd(['build/android/adb_logcat_monitor.py', logcat_dir])
if 'unit' in options.test_filter: if 'unit' in options.test_filter:
RunTestSuites(options, None) RunTestSuites(options, gtest_config.STABLE_TEST_SUITES)
if 'ui' in options.test_filter: if 'ui' in options.test_filter:
for test in INSTRUMENTATION_TESTS.itervalues(): for test in INSTRUMENTATION_TESTS.itervalues():
RunInstrumentationSuite(options, test) RunInstrumentationSuite(options, test)
if 'webkit' in options.test_filter: if 'webkit' in options.test_filter:
RunTestSuites(options, 'webkit_unit_tests') RunTestSuites(options, ['webkit_unit_tests', 'TestWebKitAPI'])
RunTestSuites(options, 'TestWebKitAPI')
RunWebkitLint(options.target) RunWebkitLint(options.target)
if 'webkit_layout' in options.test_filter: if 'webkit_layout' in options.test_filter:
RunWebkitLayoutTests(options) RunWebkitLayoutTests(options)
if options.experimental: if options.experimental:
RunTestSuites(options, 'sandbox_linux_unittests') RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES)
# Print logcat, kill logcat monitor # Print logcat, kill logcat monitor
buildbot_report.PrintNamedStep('Logcat dump') buildbot_report.PrintNamedStep('logcat_dump')
RunCmd(['build/android/adb_logcat_printer.py', logcat_dir]) RunCmd(['build/android/adb_logcat_printer.py', logcat_dir])
buildbot_report.PrintNamedStep('Test report') buildbot_report.PrintNamedStep('test_report')
for report in glob.glob( for report in glob.glob(
os.path.join(CHROME_SRC, 'out', options.target, 'test_logs', '*.log')): os.path.join(CHROME_SRC, 'out', options.target, 'test_logs', '*.log')):
subprocess.Popen(['cat', report]).wait() subprocess.Popen(['cat', report]).wait()
......
...@@ -162,7 +162,6 @@ def main(): ...@@ -162,7 +162,6 @@ def main():
options, args = parser.parse_args() options, args = parser.parse_args()
if args: if args:
parser.error('Unknown options %s' % args) parser.error('Unknown options %s' % args)
buildbot_report.PrintNamedStep('Device Status Check')
devices = android_commands.GetAttachedDevices() devices = android_commands.GetAttachedDevices()
types, builds, reports, errors = [], [], [], [] types, builds, reports, errors = [], [], [], []
if devices: if devices:
......
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Configuration file for android gtest suites."""
# Add new suites here before upgrading them to the stable list below.
EXPERIMENTAL_TEST_SUITES = [
'sandbox_linux_unittests',
]
# Do not modify this list without approval of an android owner.
# This list determines which suites are run by default, both for local
# testing and on android trybots running on commit-queue.
STABLE_TEST_SUITES = [
'base_unittests',
'cc_unittests',
'content_unittests',
'gpu_unittests',
'ipc_tests',
'media_unittests',
'net_unittests',
'sql_unittests',
'sync_unit_tests',
'ui_unittests',
'unit_tests',
'webkit_compositor_bindings_unittests',
'android_webview_unittests',
]
...@@ -46,11 +46,11 @@ import sys ...@@ -46,11 +46,11 @@ import sys
import time import time
from pylib import android_commands from pylib import android_commands
from pylib import buildbot_report
from pylib import cmd_helper from pylib import cmd_helper
from pylib import ports from pylib import ports
from pylib.base_test_sharder import BaseTestSharder from pylib.base_test_sharder import BaseTestSharder
from pylib.gtest import debug_info from pylib.gtest import debug_info
from pylib.gtest import gtest_config
from pylib.gtest.single_test_runner import SingleTestRunner from pylib.gtest.single_test_runner import SingleTestRunner
from pylib.utils import emulator from pylib.utils import emulator
from pylib.utils import run_tests_helper from pylib.utils import run_tests_helper
...@@ -59,22 +59,6 @@ from pylib.utils import time_profile ...@@ -59,22 +59,6 @@ from pylib.utils import time_profile
from pylib.utils import xvfb from pylib.utils import xvfb
_TEST_SUITES = ['base_unittests',
'cc_unittests',
'content_unittests',
'gpu_unittests',
'ipc_tests',
'media_unittests',
'net_unittests',
'sql_unittests',
'sync_unit_tests',
'ui_unittests',
'unit_tests',
'webkit_compositor_bindings_unittests',
'android_webview_unittests',
]
def FullyQualifiedTestSuites(exe, option_test_suite, build_type): def FullyQualifiedTestSuites(exe, option_test_suite, build_type):
"""Get a list of absolute paths to test suite targets. """Get a list of absolute paths to test suite targets.
...@@ -87,7 +71,7 @@ def FullyQualifiedTestSuites(exe, option_test_suite, build_type): ...@@ -87,7 +71,7 @@ def FullyQualifiedTestSuites(exe, option_test_suite, build_type):
if option_test_suite: if option_test_suite:
all_test_suites = [option_test_suite] all_test_suites = [option_test_suite]
else: else:
all_test_suites = _TEST_SUITES all_test_suites = gtest_config.STABLE_TEST_SUITES
if exe: if exe:
qualified_test_suites = [os.path.join(test_suite_dir, t) qualified_test_suites = [os.path.join(test_suite_dir, t)
...@@ -103,7 +87,7 @@ def FullyQualifiedTestSuites(exe, option_test_suite, build_type): ...@@ -103,7 +87,7 @@ def FullyQualifiedTestSuites(exe, option_test_suite, build_type):
raise Exception('Test suite %s not found in %s.\n' raise Exception('Test suite %s not found in %s.\n'
'Supported test suites:\n %s\n' 'Supported test suites:\n %s\n'
'Ensure it has been built.\n' % 'Ensure it has been built.\n' %
(t, q, _TEST_SUITES)) (t, q, gtest_config.STABLE_TEST_SUITES))
return qualified_test_suites return qualified_test_suites
...@@ -239,7 +223,6 @@ def _RunATestSuite(options): ...@@ -239,7 +223,6 @@ def _RunATestSuite(options):
0 if successful, number of failing tests otherwise. 0 if successful, number of failing tests otherwise.
""" """
step_name = os.path.basename(options.test_suite).replace('-debug.apk', '') step_name = os.path.basename(options.test_suite).replace('-debug.apk', '')
buildbot_report.PrintNamedStep(step_name)
attached_devices = [] attached_devices = []
buildbot_emulators = [] buildbot_emulators = []
...@@ -254,7 +237,6 @@ def _RunATestSuite(options): ...@@ -254,7 +237,6 @@ def _RunATestSuite(options):
if not attached_devices: if not attached_devices:
logging.critical('A device must be attached and online.') logging.critical('A device must be attached and online.')
buildbot_report.PrintError()
return 1 return 1
# Reset the test port allocation. It's important to do it before starting # Reset the test port allocation. It's important to do it before starting
...@@ -323,7 +305,7 @@ def Dispatch(options): ...@@ -323,7 +305,7 @@ def Dispatch(options):
def ListTestSuites(): def ListTestSuites():
"""Display a list of available test suites.""" """Display a list of available test suites."""
print 'Available test suites are:' print 'Available test suites are:'
for test_suite in _TEST_SUITES: for test_suite in gtest_config.STABLE_TEST_SUITES:
print test_suite print test_suite
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment