| 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 25 matching lines...) Expand all Loading... |
| 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 if test_type == 'Instrumentation': |
| 44 if flakiness_server == constants.UPSTREAM_FLAKINESS_SERVER: | 44 if flakiness_server == constants.UPSTREAM_FLAKINESS_SERVER: |
| 45 assert test_package in ['ContentShellTest', | 45 assert test_package in ['ContentShellTest', |
| 46 'ChromePublicTest', |
| 46 'ChromeShellTest', | 47 'ChromeShellTest', |
| 48 'ChromeSyncShellTest', |
| 47 'AndroidWebViewTest'] | 49 'AndroidWebViewTest'] |
| 48 dashboard_test_type = ('%s_instrumentation_tests' % | 50 dashboard_test_type = ('%s_instrumentation_tests' % |
| 49 test_package.lower().rstrip('test')) | 51 test_package.lower().rstrip('test')) |
| 50 # Downstream server. | 52 # Downstream server. |
| 51 else: | 53 else: |
| 52 dashboard_test_type = 'Chromium_Android_Instrumentation' | 54 dashboard_test_type = 'Chromium_Android_Instrumentation' |
| 53 | 55 |
| 54 elif test_type == 'Unit test': | 56 elif test_type == 'Unit test': |
| 55 dashboard_test_type = test_package | 57 dashboard_test_type = test_package |
| 56 | 58 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 # instrumenation test package using different annotations. | 105 # instrumenation test package using different annotations. |
| 104 if annotation and len(annotation) == 1: | 106 if annotation and len(annotation) == 1: |
| 105 suite_name = annotation[0] | 107 suite_name = annotation[0] |
| 106 else: | 108 else: |
| 107 suite_name = test_package | 109 suite_name = test_package |
| 108 _LogToFile(results, test_type, suite_name) | 110 _LogToFile(results, test_type, suite_name) |
| 109 | 111 |
| 110 if flakiness_server: | 112 if flakiness_server: |
| 111 _LogToFlakinessDashboard(results, test_type, test_package, | 113 _LogToFlakinessDashboard(results, test_type, test_package, |
| 112 flakiness_server) | 114 flakiness_server) |
| OLD | NEW |