| 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. |
| 154 conversion_map = [ | 155 conversion_map = [ |
| 155 (test_results.ok, False, | 156 (test_results.ok, False, |
| 156 json_results_generator.JSONResultsGeneratorBase.PASS_RESULT), | 157 json_results_generator.JSONResultsGeneratorBase.PASS_RESULT), |
| 157 (test_results.failed, True, | 158 (test_results.failed, True, |
| 158 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), | 159 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), |
| 159 (test_results.crashed, True, | 160 (test_results.crashed, True, |
| 160 "C"), | 161 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), |
| 162 (test_results.timed_out, True, |
| 163 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), |
| 161 (test_results.unknown, True, | 164 (test_results.unknown, True, |
| 162 json_results_generator.JSONResultsGeneratorBase.NO_DATA_RESULT), | 165 json_results_generator.JSONResultsGeneratorBase.NO_DATA_RESULT), |
| 163 ] | 166 ] |
| 164 | 167 |
| 165 for results_list, failed, modifier in conversion_map: | 168 for results_list, failed, modifier in conversion_map: |
| 166 for single_test_result in results_list: | 169 for single_test_result in results_list: |
| 167 test_result = json_results_generator.TestResult( | 170 test_result = json_results_generator.TestResult( |
| 168 test=single_test_result.name, | 171 test=single_test_result.name, |
| 169 failed=failed, | 172 failed=failed, |
| 170 elapsed_time=single_test_result.dur / 1000) | 173 elapsed_time=single_test_result.dur / 1000) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 """Reports test results to the flakiness dashboard for Chrome for Android. | 210 """Reports test results to the flakiness dashboard for Chrome for Android. |
| 208 | 211 |
| 209 Args: | 212 Args: |
| 210 flakiness_dashboard_server: the server to upload the results to. | 213 flakiness_dashboard_server: the server to upload the results to. |
| 211 test_type: the type of the tests (as displayed by the flakiness dashboard). | 214 test_type: the type of the tests (as displayed by the flakiness dashboard). |
| 212 results: test results. | 215 results: test results. |
| 213 """ | 216 """ |
| 214 uploader = ResultsUploader(test_type) | 217 uploader = ResultsUploader(test_type) |
| 215 uploader.AddResults(results) | 218 uploader.AddResults(results) |
| 216 uploader.Upload(flakiness_dashboard_server) | 219 uploader.Upload(flakiness_dashboard_server) |
| OLD | NEW |