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

Side by Side Diff: build/android/run_instrumentation_tests.py

Issue 11780003: [Android] Revert 175082 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/pylib/utils/jar_info.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Runs both the Python and Java tests.""" 7 """Runs both the Python and Java tests."""
8 8
9 import optparse 9 import optparse
10 import os 10 import os
11 import sys 11 import sys
12 import time 12 import time
13 13
14 from pylib import apk_info
14 from pylib import buildbot_report 15 from pylib import buildbot_report
15 from pylib import constants 16 from pylib import constants
16 from pylib import ports 17 from pylib import ports
17 from pylib import run_java_tests 18 from pylib import run_java_tests
18 from pylib import run_python_tests 19 from pylib import run_python_tests
19 from pylib import run_tests_helper 20 from pylib import run_tests_helper
20 from pylib import test_options_parser 21 from pylib import test_options_parser
21 from pylib.test_result import TestResults 22 from pylib.test_result import TestResults
22 from pylib.utils import apk_and_jar_info
23 23
24 24
25 def DispatchInstrumentationTests(options): 25 def DispatchInstrumentationTests(options):
26 """Dispatches the Java and Python instrumentation tests, sharding if possible. 26 """Dispatches the Java and Python instrumentation tests, sharding if possible.
27 27
28 Uses the logging module to print the combined final results and 28 Uses the logging module to print the combined final results and
29 summary of the Java and Python tests. If the java_only option is set, only 29 summary of the Java and Python tests. If the java_only option is set, only
30 the Java tests run. If the python_only option is set, only the python tests 30 the Java tests run. If the python_only option is set, only the python tests
31 run. If neither are set, run both Java and Python tests. 31 run. If neither are set, run both Java and Python tests.
32 32
33 Args: 33 Args:
34 options: command-line options for running the Java and Python tests. 34 options: command-line options for running the Java and Python tests.
35 35
36 Returns: 36 Returns:
37 An integer representing the number of broken tests. 37 An integer representing the number of broken tests.
38 """ 38 """
39 if not options.keep_test_server_ports: 39 if not options.keep_test_server_ports:
40 # Reset the test port allocation. It's important to do it before starting 40 # Reset the test port allocation. It's important to do it before starting
41 # to dispatch any tests. 41 # to dispatch any tests.
42 if not ports.ResetTestServerPortAllocation(): 42 if not ports.ResetTestServerPortAllocation():
43 raise Exception('Failed to reset test server port.') 43 raise Exception('Failed to reset test server port.')
44 44
45 start_date = int(time.time() * 1000) 45 start_date = int(time.time() * 1000)
46 java_results = TestResults() 46 java_results = TestResults()
47 python_results = TestResults() 47 python_results = TestResults()
48 48
49 if options.run_java_tests: 49 if options.run_java_tests:
50 java_results = run_java_tests.DispatchJavaTests( 50 java_results = run_java_tests.DispatchJavaTests(
51 options, 51 options,
52 [apk_and_jar_info.ApkAndJarInfo(options.test_apk_path, 52 [apk_info.ApkInfo(options.test_apk_path, options.test_apk_jar_path)])
53 options.test_apk_jar_path)])
54 if options.run_python_tests: 53 if options.run_python_tests:
55 python_results = run_python_tests.DispatchPythonTests(options) 54 python_results = run_python_tests.DispatchPythonTests(options)
56 55
57 all_results = TestResults.FromTestResults([java_results, python_results]) 56 all_results = TestResults.FromTestResults([java_results, python_results])
58 57
59 all_results.LogFull( 58 all_results.LogFull(
60 test_type='Instrumentation', 59 test_type='Instrumentation',
61 test_package=options.test_apk, 60 test_package=options.test_apk,
62 annotation=options.annotation, 61 annotation=options.annotation,
63 build_type=options.build_type, 62 build_type=options.build_type,
(...skipping 16 matching lines...) Expand all
80 ret = 1 79 ret = 1
81 try: 80 try:
82 ret = DispatchInstrumentationTests(options) 81 ret = DispatchInstrumentationTests(options)
83 finally: 82 finally:
84 buildbot_report.PrintStepResultIfNeeded(options, ret) 83 buildbot_report.PrintStepResultIfNeeded(options, ret)
85 return ret 84 return ret
86 85
87 86
88 if __name__ == '__main__': 87 if __name__ == '__main__':
89 sys.exit(main(sys.argv)) 88 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « build/android/pylib/utils/jar_info.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698