| 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 # pylint: disable=E1002,R0201 | 6 # pylint: disable=E1002,R0201 |
| 7 | 7 |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import shutil | 10 import shutil |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), | 124 json_results_generator.JSONResultsGeneratorBase.FAIL_RESULT), |
| 125 (test_results.GetUnknown(), True, | 125 (test_results.GetUnknown(), True, |
| 126 json_results_generator.JSONResultsGeneratorBase.NO_DATA_RESULT), | 126 json_results_generator.JSONResultsGeneratorBase.NO_DATA_RESULT), |
| 127 ] | 127 ] |
| 128 | 128 |
| 129 for results_list, failed, modifier in conversion_map: | 129 for results_list, failed, modifier in conversion_map: |
| 130 for single_test_result in results_list: | 130 for single_test_result in results_list: |
| 131 test_result = json_results_generator.TestResult( | 131 test_result = json_results_generator.TestResult( |
| 132 test=single_test_result.GetName(), | 132 test=single_test_result.GetName(), |
| 133 failed=failed, | 133 failed=failed, |
| 134 elapsed_time=single_test_result.GetDur() / 1000) | 134 elapsed_time=single_test_result.GetDuration() / 1000) |
| 135 # The WebKit TestResult object sets the modifier it based on test name. | 135 # The WebKit TestResult object sets the modifier it based on test name. |
| 136 # Since we don't use the same test naming convention as WebKit the | 136 # Since we don't use the same test naming convention as WebKit the |
| 137 # modifier will be wrong, so we need to overwrite it. | 137 # modifier will be wrong, so we need to overwrite it. |
| 138 test_result.modifier = modifier | 138 test_result.modifier = modifier |
| 139 | 139 |
| 140 self._test_results_map[single_test_result.GetName()] = test_result | 140 self._test_results_map[single_test_result.GetName()] = test_result |
| 141 | 141 |
| 142 def Upload(self, test_results_server): | 142 def Upload(self, test_results_server): |
| 143 if not self._test_results_map: | 143 if not self._test_results_map: |
| 144 return | 144 return |
| (...skipping 25 matching lines...) Expand all Loading... |
| 170 """Reports test results to the flakiness dashboard for Chrome for Android. | 170 """Reports test results to the flakiness dashboard for Chrome for Android. |
| 171 | 171 |
| 172 Args: | 172 Args: |
| 173 results: test results. | 173 results: test results. |
| 174 flakiness_dashboard_server: the server to upload the results to. | 174 flakiness_dashboard_server: the server to upload the results to. |
| 175 test_type: the type of the tests (as displayed by the flakiness dashboard). | 175 test_type: the type of the tests (as displayed by the flakiness dashboard). |
| 176 """ | 176 """ |
| 177 uploader = ResultsUploader(test_type) | 177 uploader = ResultsUploader(test_type) |
| 178 uploader.AddResults(results) | 178 uploader.AddResults(results) |
| 179 uploader.Upload(flakiness_dashboard_server) | 179 uploader.Upload(flakiness_dashboard_server) |
| OLD | NEW |