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

Side by Side Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 2045043002: Allow multiple devices on bisects hosts (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Move device_to_test and devices_tested variables to auto_bisect api Created 4 years, 6 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 unified diff | Download patch
OLDNEW
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 urllib 10 import urllib
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 # WebView user agent is changed, and new CTS hasn't been published to 999 # WebView user agent is changed, and new CTS hasn't been published to
1000 # reflect that. 1000 # reflect that.
1001 expected_failure_json = self.m.file.read( 1001 expected_failure_json = self.m.file.read(
1002 'Fetch the expected failures tests for CTS from chromium checkout', 1002 'Fetch the expected failures tests for CTS from chromium checkout',
1003 _CTS_CONFIG_SRC_PATH.join('expected_failure_on_bot.json'), 1003 _CTS_CONFIG_SRC_PATH.join('expected_failure_on_bot.json'),
1004 test_data = ''' 1004 test_data = '''
1005 { 1005 {
1006 "android.webkit.cts.ExampleBlacklistedTest": 1006 "android.webkit.cts.ExampleBlacklistedTest":
1007 [ 1007 [
1008 { 1008 {
1009 "name": "testA", 1009 "name": "testA",
RobertoCN 2016/06/21 22:47:01 if the only changes in this file are whitespace fi
Ziqi Xiong 2016/06/22 17:38:22 Done.
1010 "_bug_id": "crbug.com/123" 1010 "_bug_id": "crbug.com/123"
1011 }, 1011 },
1012 {"name": "testB"} 1012 {"name": "testB"}
1013 ] 1013 ]
1014 }''' 1014 }'''
1015 ) 1015 )
1016 expected_failure = self.m.json.loads(expected_failure_json) 1016 expected_failure = self.m.json.loads(expected_failure_json)
1017 1017
1018 cts_base_dir = self.m.path['build'].join('site_config', 'cts') 1018 cts_base_dir = self.m.path['build'].join('site_config', 'cts')
1019 cts_zip_path = cts_base_dir.join(_cts_file_name) 1019 cts_zip_path = cts_base_dir.join(_cts_file_name)
1020 cts_extract_dir = cts_base_dir.join('unzipped') 1020 cts_extract_dir = cts_base_dir.join('unzipped')
1021 if not self.m.path.exists(cts_zip_path): 1021 if not self.m.path.exists(cts_zip_path):
1022 with self.m.step.nest('Update CTS'): 1022 with self.m.step.nest('Update CTS'):
1023 # Remove all old cts files before downloading new one. 1023 # Remove all old cts files before downloading new one.
1024 self.m.file.rmtree('Delete old CTS', cts_base_dir) 1024 self.m.file.rmtree('Delete old CTS', cts_base_dir)
1025 self.m.file.makedirs('Create CTS dir', cts_base_dir) 1025 self.m.file.makedirs('Create CTS dir', cts_base_dir)
1026 self.m.gsutil.download(name='Download new CTS', 1026 self.m.gsutil.download(name='Download new CTS',
1027 bucket='chromium-cts', 1027 bucket='chromium-cts',
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 1065
1066 for test_class in test_classes: 1066 for test_class in test_classes:
1067 class_name = 'android.webkit.cts.%s' % test_class.get('name') 1067 class_name = 'android.webkit.cts.%s' % test_class.get('name')
1068 test_methods = test_class.findall('./Test') 1068 test_methods = test_class.findall('./Test')
1069 1069
1070 for test_method in test_methods: 1070 for test_method in test_methods:
1071 method_name = '%s#%s' % (class_name, test_method.get('name')) 1071 method_name = '%s#%s' % (class_name, test_method.get('name'))
1072 if test_method.get('result') == 'notExecuted': 1072 if test_method.get('result') == 'notExecuted':
1073 not_executed_tests.append(method_name) 1073 not_executed_tests.append(method_name)
1074 elif (test_method.find('./FailedScene') is not None and 1074 elif (test_method.find('./FailedScene') is not None and
1075 test_method.get('name') not in 1075 test_method.get('name') not in
1076 [ t.get('name') for t in 1076 [ t.get('name') for t in
1077 expected_failure.get(class_name, []) ]): 1077 expected_failure.get(class_name, []) ]):
1078 unexpected_test_failures.append(method_name) 1078 unexpected_test_failures.append(method_name)
1079 1079
1080 if unexpected_test_failures or not_executed_tests: 1080 if unexpected_test_failures or not_executed_tests:
1081 self.m.step.active_result.presentation.status = self.m.step.FAILURE 1081 self.m.step.active_result.presentation.status = self.m.step.FAILURE
1082 self.m.step.active_result.presentation.step_text += ( 1082 self.m.step.active_result.presentation.step_text += (
1083 self.m.test_utils.format_step_text( 1083 self.m.test_utils.format_step_text(
1084 [['unexpected failures:', unexpected_test_failures], 1084 [['unexpected failures:', unexpected_test_failures],
1085 ['not executed:', not_executed_tests]])) 1085 ['not executed:', not_executed_tests]]))
1086 1086
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 script = self.c.test_runner 1296 script = self.c.test_runner
1297 if wrapper_script_suite_name: 1297 if wrapper_script_suite_name:
1298 script = self.m.chromium.output_dir.join('bin', 'run_%s' % 1298 script = self.m.chromium.output_dir.join('bin', 'run_%s' %
1299 wrapper_script_suite_name) 1299 wrapper_script_suite_name)
1300 else: 1300 else:
1301 env = kwargs.get('env', {}) 1301 env = kwargs.get('env', {})
1302 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', 1302 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR',
1303 self.m.chromium.output_dir) 1303 self.m.chromium.output_dir)
1304 kwargs['env'] = env 1304 kwargs['env'] = env
1305 return self.m.python(step_name, script, args, **kwargs) 1305 return self.m.python(step_name, script, args, **kwargs)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698