| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 """Module containing utility functions for reporting results.""" | 5 """Module containing utility functions for reporting results.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 results.GetShortForm()) | 33 results.GetShortForm()) |
| 34 | 34 |
| 35 | 35 |
| 36 def _LogToFlakinessDashboard(results, test_type, test_package, | 36 def _LogToFlakinessDashboard(results, test_type, test_package, |
| 37 flakiness_server): | 37 flakiness_server): |
| 38 """Upload results to the flakiness dashboard""" | 38 """Upload results to the flakiness dashboard""" |
| 39 logging.info('Upload results for test type "%s", test package "%s" to %s', | 39 logging.info('Upload results for test type "%s", test package "%s" to %s', |
| 40 test_type, test_package, flakiness_server) | 40 test_type, test_package, flakiness_server) |
| 41 | 41 |
| 42 try: | 42 try: |
| 43 if test_type == 'Instrumentation': | 43 # TODO(jbudorick): remove Instrumentation once instrumentation tests |
| 44 # switch to platform mode. |
| 45 if test_type in ('instrumentation', 'Instrumentation'): |
| 44 if flakiness_server == constants.UPSTREAM_FLAKINESS_SERVER: | 46 if flakiness_server == constants.UPSTREAM_FLAKINESS_SERVER: |
| 45 assert test_package in ['ContentShellTest', | 47 assert test_package in ['ContentShellTest', |
| 46 'ChromePublicTest', | 48 'ChromePublicTest', |
| 47 'ChromeSyncShellTest', | 49 'ChromeSyncShellTest', |
| 48 'AndroidWebViewTest'] | 50 'AndroidWebViewTest'] |
| 49 dashboard_test_type = ('%s_instrumentation_tests' % | 51 dashboard_test_type = ('%s_instrumentation_tests' % |
| 50 test_package.lower().rstrip('test')) | 52 test_package.lower().rstrip('test')) |
| 51 # Downstream server. | 53 # Downstream server. |
| 52 else: | 54 else: |
| 53 dashboard_test_type = 'Chromium_Android_Instrumentation' | 55 dashboard_test_type = 'Chromium_Android_Instrumentation' |
| 54 | 56 |
| 55 elif test_type == 'Unit test': | 57 elif test_type == 'gtest': |
| 56 dashboard_test_type = test_package | 58 dashboard_test_type = test_package |
| 57 | 59 |
| 58 else: | 60 else: |
| 59 logging.warning('Invalid test type') | 61 logging.warning('Invalid test type') |
| 60 return | 62 return |
| 61 | 63 |
| 62 results_uploader.Upload( | 64 results_uploader.Upload( |
| 63 results, flakiness_server, dashboard_test_type) | 65 results, flakiness_server, dashboard_test_type) |
| 64 | 66 |
| 65 except Exception: # pylint: disable=broad-except | 67 except Exception: # pylint: disable=broad-except |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 # instrumenation test package using different annotations. | 106 # instrumenation test package using different annotations. |
| 105 if annotation and len(annotation) == 1: | 107 if annotation and len(annotation) == 1: |
| 106 suite_name = annotation[0] | 108 suite_name = annotation[0] |
| 107 else: | 109 else: |
| 108 suite_name = test_package | 110 suite_name = test_package |
| 109 _LogToFile(results, test_type, suite_name) | 111 _LogToFile(results, test_type, suite_name) |
| 110 | 112 |
| 111 if flakiness_server: | 113 if flakiness_server: |
| 112 _LogToFlakinessDashboard(results, test_type, test_package, | 114 _LogToFlakinessDashboard(results, test_type, test_package, |
| 113 flakiness_server) | 115 flakiness_server) |
| OLD | NEW |