Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 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 import contextlib | 5 import contextlib |
| 6 import datetime | 6 import datetime |
| 7 import json | 7 import json |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import sys | 10 import sys |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1060 # WebView user agent is changed, and new CTS hasn't been published to | 1060 # WebView user agent is changed, and new CTS hasn't been published to |
| 1061 # reflect that. | 1061 # reflect that. |
| 1062 expected_failure_json = self.m.file.read( | 1062 expected_failure_json = self.m.file.read( |
| 1063 'Fetch the expected failures tests for CTS from chromium checkout', | 1063 'Fetch the expected failures tests for CTS from chromium checkout', |
| 1064 _CTS_CONFIG_SRC_PATH.join('expected_failure_on_bot.json'), | 1064 _CTS_CONFIG_SRC_PATH.join('expected_failure_on_bot.json'), |
| 1065 test_data = ''' | 1065 test_data = ''' |
| 1066 { | 1066 { |
| 1067 "android.webkit.cts.ExampleBlacklistedTest": | 1067 "android.webkit.cts.ExampleBlacklistedTest": |
| 1068 [ | 1068 [ |
| 1069 { | 1069 { |
| 1070 "name": "testA", | 1070 "name": "testA", |
|
RobertoCN
2016/06/28 19:36:37
Undo this change and retrain. Otherwise we'll need
| |
| 1071 "_bug_id": "crbug.com/123" | 1071 "_bug_id": "crbug.com/123" |
| 1072 }, | 1072 }, |
| 1073 {"name": "testB"} | 1073 {"name": "testB"} |
| 1074 ] | 1074 ] |
| 1075 }''' | 1075 }''' |
| 1076 ) | 1076 ) |
| 1077 expected_failure = self.m.json.loads(expected_failure_json) | 1077 expected_failure = self.m.json.loads(expected_failure_json) |
| 1078 | 1078 |
| 1079 cts_base_dir = self.m.path['build'].join('site_config', 'cts') | 1079 cts_base_dir = self.m.path['build'].join('site_config', 'cts') |
| 1080 cts_zip_path = cts_base_dir.join(_cts_file_name) | 1080 cts_zip_path = cts_base_dir.join(_cts_file_name) |
| 1081 cts_extract_dir = cts_base_dir.join('unzipped') | 1081 cts_extract_dir = cts_base_dir.join('unzipped') |
| 1082 if not self.m.path.exists(cts_zip_path): | 1082 if not self.m.path.exists(cts_zip_path): |
| 1083 with self.m.step.nest('Update CTS'): | 1083 with self.m.step.nest('Update CTS'): |
| 1084 # Remove all old cts files before downloading new one. | 1084 # Remove all old cts files before downloading new one. |
| 1085 self.m.file.rmtree('Delete old CTS', cts_base_dir) | 1085 self.m.file.rmtree('Delete old CTS', cts_base_dir) |
| 1086 self.m.file.makedirs('Create CTS dir', cts_base_dir) | 1086 self.m.file.makedirs('Create CTS dir', cts_base_dir) |
| 1087 self.m.gsutil.download(name='Download new CTS', | 1087 self.m.gsutil.download(name='Download new CTS', |
| 1088 bucket='chromium-cts', | 1088 bucket='chromium-cts', |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1126 | 1126 |
| 1127 for test_class in test_classes: | 1127 for test_class in test_classes: |
| 1128 class_name = 'android.webkit.cts.%s' % test_class.get('name') | 1128 class_name = 'android.webkit.cts.%s' % test_class.get('name') |
| 1129 test_methods = test_class.findall('./Test') | 1129 test_methods = test_class.findall('./Test') |
| 1130 | 1130 |
| 1131 for test_method in test_methods: | 1131 for test_method in test_methods: |
| 1132 method_name = '%s#%s' % (class_name, test_method.get('name')) | 1132 method_name = '%s#%s' % (class_name, test_method.get('name')) |
| 1133 if test_method.get('result') == 'notExecuted': | 1133 if test_method.get('result') == 'notExecuted': |
| 1134 not_executed_tests.append(method_name) | 1134 not_executed_tests.append(method_name) |
| 1135 elif (test_method.find('./FailedScene') is not None and | 1135 elif (test_method.find('./FailedScene') is not None and |
| 1136 test_method.get('name') not in | 1136 test_method.get('name') not in |
| 1137 [ t.get('name') for t in | 1137 [ t.get('name') for t in |
| 1138 expected_failure.get(class_name, []) ]): | 1138 expected_failure.get(class_name, []) ]): |
| 1139 unexpected_test_failures.append(method_name) | 1139 unexpected_test_failures.append(method_name) |
| 1140 | 1140 |
| 1141 if unexpected_test_failures or not_executed_tests: | 1141 if unexpected_test_failures or not_executed_tests: |
| 1142 self.m.step.active_result.presentation.status = self.m.step.FAILURE | 1142 self.m.step.active_result.presentation.status = self.m.step.FAILURE |
| 1143 self.m.step.active_result.presentation.step_text += ( | 1143 self.m.step.active_result.presentation.step_text += ( |
| 1144 self.m.test_utils.format_step_text( | 1144 self.m.test_utils.format_step_text( |
| 1145 [['unexpected failures:', unexpected_test_failures], | 1145 [['unexpected failures:', unexpected_test_failures], |
| 1146 ['not executed:', not_executed_tests]])) | 1146 ['not executed:', not_executed_tests]])) |
| 1147 | 1147 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1360 script = self.c.test_runner | 1360 script = self.c.test_runner |
| 1361 if wrapper_script_suite_name: | 1361 if wrapper_script_suite_name: |
| 1362 script = self.m.chromium.output_dir.join('bin', 'run_%s' % | 1362 script = self.m.chromium.output_dir.join('bin', 'run_%s' % |
| 1363 wrapper_script_suite_name) | 1363 wrapper_script_suite_name) |
| 1364 else: | 1364 else: |
| 1365 env = kwargs.get('env', {}) | 1365 env = kwargs.get('env', {}) |
| 1366 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', | 1366 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', |
| 1367 self.m.chromium.output_dir) | 1367 self.m.chromium.output_dir) |
| 1368 kwargs['env'] = env | 1368 kwargs['env'] = env |
| 1369 return self.m.python(step_name, script, args, **kwargs) | 1369 return self.m.python(step_name, script, args, **kwargs) |
| OLD | NEW |