| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 # This requires passing the actual master name (e.g. 'ChromiumFYI' not | 99 # This requires passing the actual master name (e.g. 'ChromiumFYI' not |
| 100 # 'chromium.fyi'). | 100 # 'chromium.fyi'). |
| 101 from slave import slave_utils # pylint: disable=F0401 | 101 from slave import slave_utils # pylint: disable=F0401 |
| 102 self._build_name = slave_utils.SlaveBuildName(constants.DIR_SOURCE_ROOT) | 102 self._build_name = slave_utils.SlaveBuildName(constants.DIR_SOURCE_ROOT) |
| 103 self._master_name = slave_utils.GetActiveMaster() | 103 self._master_name = slave_utils.GetActiveMaster() |
| 104 else: | 104 else: |
| 105 self._build_name = 'chromium-android' | 105 self._build_name = 'chromium-android' |
| 106 buildbot_branch = os.environ.get('BUILDBOT_BRANCH') | 106 buildbot_branch = os.environ.get('BUILDBOT_BRANCH') |
| 107 if not buildbot_branch: | 107 if not buildbot_branch: |
| 108 buildbot_branch = 'master' | 108 buildbot_branch = 'master' |
| 109 else: |
| 110 # Ensure there's no leading "origin/" |
| 111 buildbot_branch = buildbot_branch[buildbot_branch.find('/') + 1:] |
| 109 self._master_name = '%s-%s' % (self._build_name, buildbot_branch) | 112 self._master_name = '%s-%s' % (self._build_name, buildbot_branch) |
| 110 | 113 |
| 111 self._test_results_map = {} | 114 self._test_results_map = {} |
| 112 | 115 |
| 113 def AddResults(self, test_results): | 116 def AddResults(self, test_results): |
| 114 # TODO(frankf): Differentiate between fail/crash/timeouts. | 117 # TODO(frankf): Differentiate between fail/crash/timeouts. |
| 115 conversion_map = [ | 118 conversion_map = [ |
| 116 (test_results.GetPass(), False, | 119 (test_results.GetPass(), False, |
| 117 json_results_generator.JSONResultsGeneratorBase.PASS_RESULT), | 120 json_results_generator.JSONResultsGeneratorBase.PASS_RESULT), |
| 118 (test_results.GetFail(), True, | 121 (test_results.GetFail(), True, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 """Reports test results to the flakiness dashboard for Chrome for Android. | 172 """Reports test results to the flakiness dashboard for Chrome for Android. |
| 170 | 173 |
| 171 Args: | 174 Args: |
| 172 results: test results. | 175 results: test results. |
| 173 flakiness_dashboard_server: the server to upload the results to. | 176 flakiness_dashboard_server: the server to upload the results to. |
| 174 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). |
| 175 """ | 178 """ |
| 176 uploader = ResultsUploader(test_type) | 179 uploader = ResultsUploader(test_type) |
| 177 uploader.AddResults(results) | 180 uploader.AddResults(results) |
| 178 uploader.Upload(flakiness_dashboard_server) | 181 uploader.Upload(flakiness_dashboard_server) |
| OLD | NEW |