OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Uploads the results to the flakiness dashboard server.""" | 5 """Uploads the results to the flakiness dashboard server.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import shutil | 9 import shutil |
10 import subprocess | 10 import subprocess |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 else: | 144 else: |
145 self._build_name = 'chromium-android' | 145 self._build_name = 'chromium-android' |
146 buildbot_branch = os.environ.get('BUILDBOT_BRANCH') | 146 buildbot_branch = os.environ.get('BUILDBOT_BRANCH') |
147 if not buildbot_branch: | 147 if not buildbot_branch: |
148 buildbot_branch = 'master' | 148 buildbot_branch = 'master' |
149 self._master_name = '%s-%s' % (self._build_name, buildbot_branch) | 149 self._master_name = '%s-%s' % (self._build_name, buildbot_branch) |
150 | 150 |
151 self._test_results_map = {} | 151 self._test_results_map = {} |
152 | 152 |
153 def AddResults(self, test_results): | 153 def AddResults(self, test_results): |
154 # TODO(frankf): Differentiate between fail/crash/timeouts. | |
155 conversion_map = [ | 154 conversion_map = [ |
156 (test_results.ok, False, | 155 (test_results.ok, False, |
157 json_results_generator.JSONResultsGeneratorBase.PASS_RESULT), | 156 json_results_generator.JSONResultsGeneratorBase.PASS_RESULT), |
158 (test_results.failed, True, | 157 (test_results.failed, True, |
159 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), | 158 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), |
160 (test_results.crashed, True, | 159 (test_results.crashed, True, |
161 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), | 160 "C"), |
162 (test_results.timed_out, True, | |
163 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), | |
164 (test_results.unknown, True, | 161 (test_results.unknown, True, |
165 json_results_generator.JSONResultsGeneratorBase.NO_DATA_RESULT), | 162 json_results_generator.JSONResultsGeneratorBase.NO_DATA_RESULT), |
166 ] | 163 ] |
167 | 164 |
168 for results_list, failed, modifier in conversion_map: | 165 for results_list, failed, modifier in conversion_map: |
169 for single_test_result in results_list: | 166 for single_test_result in results_list: |
170 test_result = json_results_generator.TestResult( | 167 test_result = json_results_generator.TestResult( |
171 test=single_test_result.name, | 168 test=single_test_result.name, |
172 failed=failed, | 169 failed=failed, |
173 elapsed_time=single_test_result.dur / 1000) | 170 elapsed_time=single_test_result.dur / 1000) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 """Reports test results to the flakiness dashboard for Chrome for Android. | 207 """Reports test results to the flakiness dashboard for Chrome for Android. |
211 | 208 |
212 Args: | 209 Args: |
213 flakiness_dashboard_server: the server to upload the results to. | 210 flakiness_dashboard_server: the server to upload the results to. |
214 test_type: the type of the tests (as displayed by the flakiness dashboard). | 211 test_type: the type of the tests (as displayed by the flakiness dashboard). |
215 results: test results. | 212 results: test results. |
216 """ | 213 """ |
217 uploader = ResultsUploader(test_type) | 214 uploader = ResultsUploader(test_type) |
218 uploader.AddResults(results) | 215 uploader.AddResults(results) |
219 uploader.Upload(flakiness_dashboard_server) | 216 uploader.Upload(flakiness_dashboard_server) |
OLD | NEW |