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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 tmp_folder=tmp_folder, | 155 tmp_folder=tmp_folder, |
156 test_results_map=self._test_results_map, | 156 test_results_map=self._test_results_map, |
157 test_results_server=test_results_server, | 157 test_results_server=test_results_server, |
158 test_type=self._tests_type, | 158 test_type=self._tests_type, |
159 master_name=self._master_name) | 159 master_name=self._master_name) |
160 | 160 |
161 json_files = ["incremental_results.json", "times_ms.json"] | 161 json_files = ["incremental_results.json", "times_ms.json"] |
162 results_generator.GenerateJSONOutput() | 162 results_generator.GenerateJSONOutput() |
163 results_generator.GenerateTimesMSFile() | 163 results_generator.GenerateTimesMSFile() |
164 results_generator.UploadJSONFiles(json_files) | 164 results_generator.UploadJSONFiles(json_files) |
165 except Exception as e: | 165 except Exception as e: # pylint: disable=broad-except |
166 logging.error("Uploading results to test server failed: %s." % e) | 166 logging.error("Uploading results to test server failed: %s.", e) |
167 finally: | 167 finally: |
168 shutil.rmtree(tmp_folder) | 168 shutil.rmtree(tmp_folder) |
169 | 169 |
170 | 170 |
171 def Upload(results, flakiness_dashboard_server, test_type): | 171 def Upload(results, flakiness_dashboard_server, test_type): |
172 """Reports test results to the flakiness dashboard for Chrome for Android. | 172 """Reports test results to the flakiness dashboard for Chrome for Android. |
173 | 173 |
174 Args: | 174 Args: |
175 results: test results. | 175 results: test results. |
176 flakiness_dashboard_server: the server to upload the results to. | 176 flakiness_dashboard_server: the server to upload the results to. |
177 test_type: the type of the tests (as displayed by the flakiness dashboard). | 177 test_type: the type of the tests (as displayed by the flakiness dashboard). |
178 """ | 178 """ |
179 uploader = ResultsUploader(test_type) | 179 uploader = ResultsUploader(test_type) |
180 uploader.AddResults(results) | 180 uploader.AddResults(results) |
181 uploader.Upload(flakiness_dashboard_server) | 181 uploader.Upload(flakiness_dashboard_server) |
OLD | NEW |