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

Side by Side Diff: tools/mb/mb.py

Issue 2503503002: MB: Run test with gtest-parallel on swarming. (Closed)
Patch Set: Removed extra whitespace. Created 4 years, 1 month 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 # 3 #
4 # Use of this source code is governed by a BSD-style license 4 # Use of this source code is governed by a BSD-style license
5 # that can be found in the LICENSE file in the root of the source 5 # that can be found in the LICENSE file in the root of the source
6 # tree. An additional intellectual property rights grant can be found 6 # tree. An additional intellectual property rights grant can be found
7 # in the file PATENTS. All contributing project authors may 7 # in the file PATENTS. All contributing project authors may
8 # be found in the AUTHORS file in the root of the source tree. 8 # be found in the AUTHORS file in the root of the source tree.
9 9
10 """MB - the Meta-Build wrapper around GYP and GN 10 """MB - the Meta-Build wrapper around GYP and GN
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 1070
1071 asan = 'is_asan=true' in vals['gn_args'] 1071 asan = 'is_asan=true' in vals['gn_args']
1072 msan = 'is_msan=true' in vals['gn_args'] 1072 msan = 'is_msan=true' in vals['gn_args']
1073 tsan = 'is_tsan=true' in vals['gn_args'] 1073 tsan = 'is_tsan=true' in vals['gn_args']
1074 1074
1075 isolate_map = self.ReadIsolateMap() 1075 isolate_map = self.ReadIsolateMap()
1076 test_type = isolate_map[target]['type'] 1076 test_type = isolate_map[target]['type']
1077 1077
1078 executable = isolate_map[target].get('executable', target) 1078 executable = isolate_map[target].get('executable', target)
1079 executable_suffix = '.exe' if self.platform == 'win32' else '' 1079 executable_suffix = '.exe' if self.platform == 'win32' else ''
1080 executable_prefix = '.\\' if self.platform == 'win32' else './'
1080 1081
1081 cmdline = [] 1082 cmdline = []
1082 extra_files = [] 1083 extra_files = []
1084 common_cmdline = [
1085 executable_prefix + str(executable) + executable_suffix,
1086 '--',
1087 '--asan=%d' % asan,
1088 '--msan=%d' % msan,
1089 '--tsan=%d' % tsan,
1090 ]
1083 1091
1084 if test_type == 'nontest': 1092 if test_type == 'nontest':
1085 self.WriteFailureAndRaise('We should not be isolating %s.' % target, 1093 self.WriteFailureAndRaise('We should not be isolating %s.' % target,
1086 output_path=None) 1094 output_path=None)
1087 1095
1088 if android and test_type != "script": 1096 if android and test_type != "script":
1089 logdog_command = [ 1097 logdog_command = [
1090 '--logdog-bin-cmd', './../../bin/logdog_butler', 1098 '--logdog-bin-cmd', './../../bin/logdog_butler',
1091 '--project', 'chromium', 1099 '--project', 'chromium',
1092 '--service-account-json', 1100 '--service-account-json',
1093 '/creds/service_accounts/service-account-luci-logdog-publisher.json', 1101 '/creds/service_accounts/service-account-luci-logdog-publisher.json',
1094 '--prefix', 'android/swarming/logcats/${SWARMING_TASK_ID}', 1102 '--prefix', 'android/swarming/logcats/${SWARMING_TASK_ID}',
1095 '--source', '${ISOLATED_OUTDIR}/logcats', 1103 '--source', '${ISOLATED_OUTDIR}/logcats',
1096 '--name', 'unified_logcats', 1104 '--name', 'unified_logcats',
1097 ] 1105 ]
1098 test_cmdline = [ 1106 test_cmdline = [
1099 self.PathJoin('bin', 'run_%s' % target), 1107 self.PathJoin('bin', 'run_%s' % target),
1100 '--logcat-output-file', '${ISOLATED_OUTDIR}/logcats', 1108 '--logcat-output-file', '${ISOLATED_OUTDIR}/logcats',
1101 '--target-devices-file', '${SWARMING_BOT_FILE}', 1109 '--target-devices-file', '${SWARMING_BOT_FILE}',
1102 '-v' 1110 '-v'
1103 ] 1111 ]
1104 cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py'] 1112 cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py']
1105 + logdog_command + test_cmdline) 1113 + logdog_command + test_cmdline)
1106 elif use_x11 and test_type == 'windowed_test_launcher': 1114 elif use_x11 and test_type == 'windowed_test_launcher':
1107 extra_files = [ 1115 extra_files = [
1108 'xdisplaycheck', 1116 'xdisplaycheck',
1109 '../../testing/test_env.py', 1117 '../../testing/test_env.py',
1110 '../../testing/xvfb.py', 1118 '../../testing/xvfb.py',
1119 '../../third_party/gtest-parallel/gtest-parallel',
1111 ] 1120 ]
1112 cmdline = [ 1121 cmdline = [
1113 '../../testing/xvfb.py', 1122 '../../testing/xvfb.py',
1114 '.', 1123 '.',
1115 './' + str(executable) + executable_suffix, 1124 'python',
1116 '--brave-new-test-launcher', 1125 '../../third_party/gtest-parallel/gtest-parallel',
1117 '--test-launcher-bot-mode', 1126 ] + common_cmdline
1118 '--asan=%d' % asan,
1119 '--msan=%d' % msan,
1120 '--tsan=%d' % tsan,
1121 ]
1122 elif test_type in ('windowed_test_launcher', 'console_test_launcher'): 1127 elif test_type in ('windowed_test_launcher', 'console_test_launcher'):
1123 extra_files = [ 1128 extra_files = [
1124 '../../testing/test_env.py' 1129 '../../testing/test_env.py',
1130 '../../third_party/gtest-parallel/gtest-parallel',
1125 ] 1131 ]
1126 cmdline = [ 1132 cmdline = [
1127 '../../testing/test_env.py', 1133 '../../testing/test_env.py',
1128 './' + str(executable) + executable_suffix, 1134 'python',
1129 '--brave-new-test-launcher', 1135 '../../third_party/gtest-parallel/gtest-parallel',
1130 '--test-launcher-bot-mode', 1136 ] + common_cmdline
1131 '--asan=%d' % asan, 1137 elif test_type == 'non_parallel_console_test_launcher':
1132 '--msan=%d' % msan,
1133 '--tsan=%d' % tsan,
1134 ]
1135 elif test_type == 'gpu_browser_test':
1136 extra_files = [ 1138 extra_files = [
1137 '../../testing/test_env.py'
1138 ]
1139 gtest_filter = isolate_map[target]['gtest_filter']
1140 cmdline = [
1141 '../../testing/test_env.py', 1139 '../../testing/test_env.py',
1142 './browser_tests' + executable_suffix,
1143 '--test-launcher-bot-mode',
1144 '--enable-gpu',
1145 '--test-launcher-jobs=1',
1146 '--gtest_filter=%s' % gtest_filter,
1147 ]
1148 elif test_type == 'script':
1149 extra_files = [
1150 '../../testing/test_env.py'
1151 ] 1140 ]
1152 cmdline = [ 1141 cmdline = [
1153 '../../testing/test_env.py', 1142 '../../testing/test_env.py',
1154 '../../' + self.ToSrcRelPath(isolate_map[target]['script']) 1143 ] + common_cmdline
1155 ]
1156 elif test_type in ('raw'):
1157 extra_files = []
1158 cmdline = [
1159 './' + str(target) + executable_suffix,
1160 ]
1161
1162 else: 1144 else:
1163 self.WriteFailureAndRaise('No command line for %s found (test type %s).' 1145 self.WriteFailureAndRaise('No command line for %s found (test type %s).'
1164 % (target, test_type), output_path=None) 1146 % (target, test_type), output_path=None)
1165 1147
1166 cmdline += isolate_map[target].get('args', []) 1148 cmdline += isolate_map[target].get('args', [])
1167 1149
1168 return cmdline, extra_files 1150 return cmdline, extra_files
1169 1151
1170 def ToAbsPath(self, build_path, *comps): 1152 def ToAbsPath(self, build_path, *comps):
1171 return self.PathJoin(self.chromium_src_dir, 1153 return self.PathJoin(self.chromium_src_dir,
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 # Then check to see if the arg contains any metacharacters other than 1553 # Then check to see if the arg contains any metacharacters other than
1572 # double quotes; if it does, quote everything (including the double 1554 # double quotes; if it does, quote everything (including the double
1573 # quotes) for safety. 1555 # quotes) for safety.
1574 if any(a in UNSAFE_FOR_CMD for a in arg): 1556 if any(a in UNSAFE_FOR_CMD for a in arg):
1575 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) 1557 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg)
1576 return arg 1558 return arg
1577 1559
1578 1560
1579 if __name__ == '__main__': 1561 if __name__ == '__main__':
1580 sys.exit(main(sys.argv[1:])) 1562 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698