| 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 pipes | 9 import pipes |
| 10 import re | 10 import re |
| (...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1230 is_cts_v2 = (android_platform == 'N') | 1230 is_cts_v2 = (android_platform == 'N') |
| 1231 | 1231 |
| 1232 suffix = ' (%s)' % suffix if suffix else '' | 1232 suffix = ' (%s)' % suffix if suffix else '' |
| 1233 if command_line_args: | 1233 if command_line_args: |
| 1234 self._set_webview_command_line(command_line_args) | 1234 self._set_webview_command_line(command_line_args) |
| 1235 | 1235 |
| 1236 _CTS_CONFIG_SRC_PATH = self.m.path['checkout'].join( | 1236 _CTS_CONFIG_SRC_PATH = self.m.path['checkout'].join( |
| 1237 'android_webview', 'tools', 'cts_config') | 1237 'android_webview', 'tools', 'cts_config') |
| 1238 cts_filenames_json = self.m.file.read( | 1238 cts_filenames_json = self.m.file.read( |
| 1239 'Fetch CTS filename data', | 1239 'Fetch CTS filename data', |
| 1240 _CTS_CONFIG_SRC_PATH.join('webview_cts_gcs_path.json'), | 1240 _CTS_CONFIG_SRC_PATH.join('webview_cts_gcs_path_new.json'), |
| 1241 test_data=''' | 1241 test_data=''' |
| 1242 { | 1242 { |
| 1243 "arm_64": { | 1243 "arm_64": { |
| 1244 "L": "cts_arm64_L.zip" | 1244 "L": { |
| 1245 "filename": "cts_arm64_L.zip", |
| 1246 "_origin": "aosp-lollipop-mr1-cts-dev@12345" |
| 1247 }, |
| 1248 "N": { |
| 1249 "filename": "cts_arm64_N.zip", |
| 1250 "_origin": "aosp-nougat-cts-release@67890" |
| 1251 } |
| 1245 } | 1252 } |
| 1246 }''') | 1253 }''') |
| 1247 cts_filenames = self.m.json.loads(cts_filenames_json) | 1254 cts_filenames = self.m.json.loads(cts_filenames_json) |
| 1255 result = self.m.step.active_result |
| 1256 result.presentation.logs['webview_cts_gcs_path.json'] = ( |
| 1257 cts_filenames_json.splitlines()) |
| 1248 try: | 1258 try: |
| 1249 cts_filename = cts_filenames[arch][android_platform] | 1259 cts_filename = cts_filenames[arch][android_platform]["filename"] |
| 1250 except KeyError: | 1260 except KeyError: |
| 1251 raise self.m.step.StepFailure( | 1261 raise self.m.step.StepFailure( |
| 1252 'No CTS test found to use for arch:%s android:%s' % ( | 1262 'No CTS test found to use for arch:%s android:%s' % ( |
| 1253 arch, android_platform)) | 1263 arch, android_platform)) |
| 1254 | 1264 |
| 1255 expected_failure_json = self.m.file.read( | 1265 expected_failure_json = self.m.file.read( |
| 1256 'Fetch expected failures data', | 1266 'Fetch expected failures data', |
| 1257 _CTS_CONFIG_SRC_PATH.join('expected_failure_on_bot.json'), | 1267 _CTS_CONFIG_SRC_PATH.join('expected_failure_on_bot.json'), |
| 1258 test_data = ''' | 1268 test_data = ''' |
| 1259 { | 1269 { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 cts_v1_command = [cts_path, 'run', 'cts', '-p', 'android.webkit'] | 1306 cts_v1_command = [cts_path, 'run', 'cts', '-p', 'android.webkit'] |
| 1297 cts_v2_command = [cts_path, 'run', 'cts', '-m', 'CtsWebkitTestCases'] | 1307 cts_v2_command = [cts_path, 'run', 'cts', '-m', 'CtsWebkitTestCases'] |
| 1298 self.m.step('Run CTS%s' % suffix, | 1308 self.m.step('Run CTS%s' % suffix, |
| 1299 cts_v2_command if is_cts_v2 else cts_v1_command, | 1309 cts_v2_command if is_cts_v2 else cts_v1_command, |
| 1300 env=env, stdout=self.m.raw_io.output()) | 1310 env=env, stdout=self.m.raw_io.output()) |
| 1301 finally: | 1311 finally: |
| 1302 result = self.m.step.active_result | 1312 result = self.m.step.active_result |
| 1303 if result.stdout: | 1313 if result.stdout: |
| 1304 result.presentation.logs['stdout'] = result.stdout.splitlines() | 1314 result.presentation.logs['stdout'] = result.stdout.splitlines() |
| 1305 result.presentation.logs['disabled_tests'] = ( | 1315 result.presentation.logs['disabled_tests'] = ( |
| 1306 expected_failure_json.split('\n')) | 1316 expected_failure_json.splitlines()) |
| 1307 | 1317 |
| 1308 from xml.etree import ElementTree | 1318 from xml.etree import ElementTree |
| 1309 | 1319 |
| 1310 def find_test_report_xml(test_output): | 1320 def find_test_report_xml(test_output): |
| 1311 test_results_line = ('Test Result: ' if is_cts_v2 else | 1321 test_results_line = ('Test Result: ' if is_cts_v2 else |
| 1312 'Created xml report file at file://') | 1322 'Created xml report file at file://') |
| 1313 if test_output: | 1323 if test_output: |
| 1314 for line in test_output.splitlines(): | 1324 for line in test_output.splitlines(): |
| 1315 split = line.split(test_results_line) | 1325 split = line.split(test_results_line) |
| 1316 if (len(split) > 1): | 1326 if (len(split) > 1): |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 script = self.c.test_runner | 1576 script = self.c.test_runner |
| 1567 if wrapper_script_suite_name: | 1577 if wrapper_script_suite_name: |
| 1568 script = self.m.chromium.output_dir.join('bin', 'run_%s' % | 1578 script = self.m.chromium.output_dir.join('bin', 'run_%s' % |
| 1569 wrapper_script_suite_name) | 1579 wrapper_script_suite_name) |
| 1570 else: | 1580 else: |
| 1571 env = kwargs.get('env', {}) | 1581 env = kwargs.get('env', {}) |
| 1572 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', | 1582 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', |
| 1573 self.m.chromium.output_dir) | 1583 self.m.chromium.output_dir) |
| 1574 kwargs['env'] = env | 1584 kwargs['env'] = env |
| 1575 return self.m.python(step_name, script, args, **kwargs) | 1585 return self.m.python(step_name, script, args, **kwargs) |
| OLD | NEW |