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 | |
11 import sys | 10 import sys |
12 import tempfile | 11 import tempfile |
13 import xml | 12 import xml |
14 | 13 |
15 | 14 |
16 # Include path when ran from a Chromium checkout. | 15 # Include path when ran from a Chromium checkout. |
17 sys.path.append( | 16 sys.path.append( |
18 os.path.abspath(os.path.join(os.path.dirname(__file__), | 17 os.path.abspath(os.path.join(os.path.dirname(__file__), |
19 os.pardir, os.pardir, os.pardir, os.pardir, | 18 os.pardir, os.pardir, os.pardir, os.pardir, |
20 'third_party', 'WebKit', 'Tools', 'Scripts'))) | 19 'third_party', 'WebKit', 'Tools', 'Scripts'))) |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 test_results_map=self._test_results_map, | 180 test_results_map=self._test_results_map, |
182 test_results_server=test_results_server, | 181 test_results_server=test_results_server, |
183 test_type=self._tests_type, | 182 test_type=self._tests_type, |
184 master_name=self._master_name) | 183 master_name=self._master_name) |
185 | 184 |
186 json_files = ["incremental_results.json", "times_ms.json"] | 185 json_files = ["incremental_results.json", "times_ms.json"] |
187 results_generator.generate_json_output() | 186 results_generator.generate_json_output() |
188 results_generator.generate_times_ms_file() | 187 results_generator.generate_times_ms_file() |
189 results_generator.upload_json_files(json_files) | 188 results_generator.upload_json_files(json_files) |
190 except Exception as e: | 189 except Exception as e: |
191 logging.error("Uploading results to test server failed: %s." % e); | 190 logging.error("Uploading results to test server failed: %s." % e) |
192 finally: | 191 finally: |
193 shutil.rmtree(tmp_folder) | 192 shutil.rmtree(tmp_folder) |
194 | 193 |
195 | 194 |
196 def Upload(results, flakiness_dashboard_server, test_type): | 195 def Upload(results, flakiness_dashboard_server, test_type): |
197 """Reports test results to the flakiness dashboard for Chrome for Android. | 196 """Reports test results to the flakiness dashboard for Chrome for Android. |
198 | 197 |
199 Args: | 198 Args: |
200 results: test results. | 199 results: test results. |
201 flakiness_dashboard_server: the server to upload the results to. | 200 flakiness_dashboard_server: the server to upload the results to. |
202 test_type: the type of the tests (as displayed by the flakiness dashboard). | 201 test_type: the type of the tests (as displayed by the flakiness dashboard). |
203 """ | 202 """ |
204 uploader = ResultsUploader(test_type) | 203 uploader = ResultsUploader(test_type) |
205 uploader.AddResults(results) | 204 uploader.AddResults(results) |
206 uploader.Upload(flakiness_dashboard_server) | 205 uploader.Upload(flakiness_dashboard_server) |
OLD | NEW |