OLD | NEW |
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 sys | 11 import sys |
11 import time | 12 import time |
12 | 13 |
13 from pylib import apk_info | 14 from pylib import apk_info |
14 from pylib import buildbot_report | 15 from pylib import buildbot_report |
| 16 from pylib import constants |
| 17 from pylib import flakiness_dashboard_results_uploader |
15 from pylib import ports | 18 from pylib import ports |
16 from pylib import run_java_tests | 19 from pylib import run_java_tests |
17 from pylib import run_python_tests | 20 from pylib import run_python_tests |
18 from pylib import run_tests_helper | 21 from pylib import run_tests_helper |
19 from pylib import test_options_parser | 22 from pylib import test_options_parser |
20 from pylib.test_result import TestResults | 23 from pylib.test_result import TestResults |
21 | 24 |
22 | 25 |
23 def SummarizeResults(java_results, python_results, annotation, build_type): | 26 def SummarizeResults(java_results, python_results, annotation, build_type): |
24 """Summarize the results from the various test types. | 27 """Summarize the results from the various test types. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 67 |
65 if options.run_java_tests: | 68 if options.run_java_tests: |
66 java_results = run_java_tests.DispatchJavaTests( | 69 java_results = run_java_tests.DispatchJavaTests( |
67 options, | 70 options, |
68 [apk_info.ApkInfo(options.test_apk_path, options.test_apk_jar_path)]) | 71 [apk_info.ApkInfo(options.test_apk_path, options.test_apk_jar_path)]) |
69 if options.run_python_tests: | 72 if options.run_python_tests: |
70 python_results = run_python_tests.DispatchPythonTests(options) | 73 python_results = run_python_tests.DispatchPythonTests(options) |
71 | 74 |
72 all_results, summary_string, num_failing = SummarizeResults( | 75 all_results, summary_string, num_failing = SummarizeResults( |
73 java_results, python_results, options.annotation, options.build_type) | 76 java_results, python_results, options.annotation, options.build_type) |
| 77 |
| 78 if options.flakiness_dashboard_server: |
| 79 flakiness_dashboard_results_uploader.Upload( |
| 80 options.flakiness_dashboard_server, 'Chromium_Android_Instrumentation', |
| 81 TestResults.FromTestResults([java_results, python_results])) |
| 82 |
74 return num_failing | 83 return num_failing |
75 | 84 |
76 | 85 |
77 def main(argv): | 86 def main(argv): |
78 option_parser = optparse.OptionParser() | 87 option_parser = optparse.OptionParser() |
79 test_options_parser.AddInstrumentationOptions(option_parser) | 88 test_options_parser.AddInstrumentationOptions(option_parser) |
80 options, args = option_parser.parse_args(argv) | 89 options, args = option_parser.parse_args(argv) |
81 test_options_parser.ValidateInstrumentationOptions(option_parser, options, | 90 test_options_parser.ValidateInstrumentationOptions(option_parser, options, |
82 args) | 91 args) |
83 | 92 |
84 run_tests_helper.SetLogLevel(options.verbose_count) | 93 run_tests_helper.SetLogLevel(options.verbose_count) |
85 buildbot_report.PrintNamedStep( | 94 buildbot_report.PrintNamedStep( |
86 'Instrumentation tests: %s - %s' % (', '.join(options.annotation), | 95 'Instrumentation tests: %s - %s' % (', '.join(options.annotation), |
87 options.test_apk)) | 96 options.test_apk)) |
88 return DispatchInstrumentationTests(options) | 97 return DispatchInstrumentationTests(options) |
89 | 98 |
90 | 99 |
91 if __name__ == '__main__': | 100 if __name__ == '__main__': |
92 sys.exit(main(sys.argv)) | 101 sys.exit(main(sys.argv)) |
OLD | NEW |