Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2473)

Unified Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 2206113002: [WebView] Update CTS logic to load test name from json. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: [WebView] Update CTS logic to load test name from json. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium_android/example.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/chromium_android/api.py
diff --git a/scripts/slave/recipe_modules/chromium_android/api.py b/scripts/slave/recipe_modules/chromium_android/api.py
index e343d2d12a1737a682913a01c0d87d462b48cbfd..154ccbf6f3bc4861fd4cac16f0557a392d76a098 100644
--- a/scripts/slave/recipe_modules/chromium_android/api.py
+++ b/scripts/slave/recipe_modules/chromium_android/api.py
@@ -1149,27 +1149,33 @@ class AndroidApi(recipe_api.RecipeApi):
'build', 'android', 'adb_command_line.py'),
command_line_script_args)
- def run_webview_cts(self, command_line_args=None, suffix=None):
+ def run_webview_cts(self, command_line_args=None, suffix=None,
+ android_platform='L', arch='arm_64'):
the real yoland 2016/08/03 23:25:01 wouldn't the n bot still run this without android_
mikecase (-- gone --) 2016/08/03 23:34:27 Yes, yeah............................... So about
suffix = ' (%s)' % suffix if suffix else ''
if command_line_args:
self._set_webview_command_line(command_line_args)
_CTS_CONFIG_SRC_PATH = self.m.path['checkout'].join(
'android_webview', 'tools', 'cts_config')
- _cts_file_name = self.m.file.read(
- 'Fetch for the name of the cts file',
- _CTS_CONFIG_SRC_PATH.join('webview_cts_gcs_path.txt'),
- test_data='android-cts-5.1_r5-linux_x86-arm.zip')
- _CTS_XML_TESTCASE_ELEMENTS = ('./TestPackage/TestSuite[@name="android"]/'
- 'TestSuite[@name="webkit"]/'
- 'TestSuite[@name="cts"]/TestCase')
- self_result = self.m.step.active_result
- self_result.presentation.logs['cts_file_name'] = [_cts_file_name]
- _cts_file_name = _cts_file_name.strip()
- # WebView user agent is changed, and new CTS hasn't been published to
- # reflect that.
+ cts_filenames_json = self.m.file.read(
+ 'Fetch CTS filename data',
+ _CTS_CONFIG_SRC_PATH.join('webview_cts_gcs_path.json'),
+ test_data='''
+ {
+ "arm_64": {
+ "L": "cts_arm64_L.zip"
+ }
+ }''')
+ cts_filenames = self.m.json.loads(cts_filenames_json)
+ try:
+ cts_filename = cts_filenames[arch][android_platform]
+ except KeyError:
+ raise self.m.step.StepFailure(
+ 'No CTS test found to use for arch:%s android:%s' % (
+ arch, android_platform))
+
expected_failure_json = self.m.file.read(
- 'Fetch the expected failures tests for CTS from chromium checkout',
+ 'Fetch expected failures data',
_CTS_CONFIG_SRC_PATH.join('expected_failure_on_bot.json'),
test_data = '''
{
@@ -1181,12 +1187,11 @@ class AndroidApi(recipe_api.RecipeApi):
},
{"name": "testB"}
]
- }'''
- )
+ }''')
expected_failure = self.m.json.loads(expected_failure_json)
cts_base_dir = self.m.path['cache'].join('android_cts')
- cts_zip_path = cts_base_dir.join(_cts_file_name)
+ cts_zip_path = cts_base_dir.join(cts_filename)
cts_extract_dir = cts_base_dir.join('unzipped')
if not self.m.path.exists(cts_zip_path):
with self.m.step.nest('Update CTS'):
@@ -1195,7 +1200,7 @@ class AndroidApi(recipe_api.RecipeApi):
self.m.file.makedirs('Create CTS dir', cts_base_dir)
self.m.gsutil.download(name='Download new CTS',
bucket='chromium-cts',
- source=_cts_file_name,
+ source=cts_filename,
dest=cts_zip_path)
self.m.zip.unzip(step_name='Extract new CTS',
zip_file=cts_zip_path,
@@ -1231,6 +1236,10 @@ class AndroidApi(recipe_api.RecipeApi):
root = ElementTree.fromstring(report_xml)
not_executed_tests = []
unexpected_test_failures = []
+
+ _CTS_XML_TESTCASE_ELEMENTS = ('./TestPackage/TestSuite[@name="android"]/'
+ 'TestSuite[@name="webkit"]/'
+ 'TestSuite[@name="cts"]/TestCase')
test_classes = root.findall(_CTS_XML_TESTCASE_ELEMENTS)
for test_class in test_classes:
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/chromium_android/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698