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

Unified Diff: build/android/run_instrumentation_tests.py

Issue 18514008: Relands test_runner.py, updates buildbot scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moves test_suite option back into gtest only Created 7 years, 5 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/run_browser_tests.py ('k') | build/android/run_tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/run_instrumentation_tests.py
diff --git a/build/android/run_instrumentation_tests.py b/build/android/run_instrumentation_tests.py
index 598331b999bad9367c6784838edd225ab29b2706..c1a4ef0d2697e0d9bf0c5119b2c255880ee7323e 100755
--- a/build/android/run_instrumentation_tests.py
+++ b/build/android/run_instrumentation_tests.py
@@ -6,73 +6,19 @@
"""Runs both the Python and Java instrumentation tests."""
-import optparse
+import logging
import os
import sys
-from pylib import buildbot_report
-from pylib import ports
-from pylib.base import base_test_result
-from pylib.host_driven import run_python_tests
-from pylib.instrumentation import dispatch
-from pylib.utils import report_results
-from pylib.utils import run_tests_helper
-from pylib.utils import test_options_parser
-
-
-def DispatchInstrumentationTests(options):
- """Dispatches the Java and Python instrumentation tests, sharding if possible.
-
- Uses the logging module to print the combined final results and
- summary of the Java and Python tests. If the java_only option is set, only
- the Java tests run. If the python_only option is set, only the python tests
- run. If neither are set, run both Java and Python tests.
-
- Args:
- options: command-line options for running the Java and Python tests.
-
- Returns:
- An integer representing the number of broken tests.
- """
- if not options.keep_test_server_ports:
- # Reset the test port allocation. It's important to do it before starting
- # to dispatch any tests.
- if not ports.ResetTestServerPortAllocation():
- raise Exception('Failed to reset test server port.')
-
- all_results = base_test_result.TestRunResults()
-
- if options.run_java_tests:
- all_results.AddTestRunResults(dispatch.Dispatch(options))
- if options.run_python_tests:
- all_results.AddTestRunResults(run_python_tests.DispatchPythonTests(options))
-
- report_results.LogFull(
- results=all_results,
- test_type='Instrumentation',
- test_package=os.path.basename(options.test_apk),
- annotation=options.annotations,
- build_type=options.build_type,
- flakiness_server=options.flakiness_dashboard_server)
-
- return len(all_results.GetNotPass())
-
-
-def main(argv):
- option_parser = optparse.OptionParser()
- test_options_parser.AddInstrumentationOptions(option_parser)
- options, args = option_parser.parse_args(argv)
- test_options_parser.ValidateInstrumentationOptions(option_parser, options,
- args)
-
- run_tests_helper.SetLogLevel(options.verbose_count)
- ret = 1
- try:
- ret = DispatchInstrumentationTests(options)
- finally:
- buildbot_report.PrintStepResultIfNeeded(options, ret)
- return ret
+from pylib import cmd_helper
if __name__ == '__main__':
- sys.exit(main(sys.argv))
+ args = ['python',
+ os.path.join(os.path.dirname(__file__), 'test_runner.py'),
+ 'instrumentation'] + sys.argv[1:]
+ logging.warning('*' * 80)
+ logging.warning('This script is deprecated and will be removed soon.')
+ logging.warning('Use the following instead: %s', ' '.join(args))
+ logging.warning('*' * 80)
+ sys.exit(cmd_helper.RunCmd(args))
« no previous file with comments | « build/android/run_browser_tests.py ('k') | build/android/run_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698