Commit 62c928ae authored by zty@chromium.org's avatar zty@chromium.org

Run android tests through runtest.py.

This CL re-lands https://codereview.chromium.org/410033002 while addressed a few issues.
1. --results-directory must be passed along with --generate-gtest-json
2. --test-platform, --annotate, --build-number, --builder-name should be passed in order to upload results to correct dashboard
3. This CL depends on https://codereview.chromium.org/414223011/ to fix a bug in runtest.py

BUG=329102
R=yfriedman@chromium.org, navabi@chromium.org, jbudorick@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288134 0039d316-1c4b-4281-b951-d872f2087c98
parent a9c120b0
......@@ -96,6 +96,31 @@ def _GetRevision(options):
return revision
def _RunTest(options, cmd, suite):
"""Run test command with runtest.py.
Args:
options: options object.
cmd: the command to run.
suite: test name.
"""
property_args = bb_utils.EncodeProperties(options)
args = [os.path.join(SLAVE_SCRIPTS_DIR, 'runtest.py')] + property_args
args += ['--test-platform', 'android']
if options.factory_properties.get('generate_gtest_json'):
args.append('--generate-json-file')
args += ['-o', 'gtest-results/%s' % suite,
'--annotate', 'gtest',
'--build-number', str(options.build_properties.get('buildnumber',
'')),
'--builder-name', options.build_properties.get('buildername', '')]
if options.target == 'Release':
args += ['--target', 'Release']
args += cmd
RunCmd(args, cwd=DIR_BUILD_ROOT)
def RunTestSuites(options, suites, suites_options=None):
"""Manages an invocation of test_runner.py for gtests.
......@@ -121,11 +146,11 @@ def RunTestSuites(options, suites, suites_options=None):
for suite in suites:
bb_annotations.PrintNamedStep(suite)
cmd = ['build/android/test_runner.py', 'gtest', '-s', suite] + args
cmd = [suite] + args
cmd += suites_options.get(suite, [])
if suite == 'content_browsertests':
cmd.append('--num_retries=1')
RunCmd(cmd)
_RunTest(options, cmd, suite)
def RunChromeDriverTests(options):
......
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