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

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

Issue 2507263003: Revert of MB: Run test with gtest-parallel on swarming. (Closed)
Patch Set: 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
« no previous file with comments | « third_party/gtest-parallel/gtest-parallel ('k') | tools/mb/mb_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 './'
1081 1080
1082 cmdline = [] 1081 cmdline = []
1083 extra_files = [] 1082 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 ]
1091 1083
1092 if test_type == 'nontest': 1084 if test_type == 'nontest':
1093 self.WriteFailureAndRaise('We should not be isolating %s.' % target, 1085 self.WriteFailureAndRaise('We should not be isolating %s.' % target,
1094 output_path=None) 1086 output_path=None)
1095 1087
1096 if android and test_type != "script": 1088 if android and test_type != "script":
1097 logdog_command = [ 1089 logdog_command = [
1098 '--logdog-bin-cmd', './../../bin/logdog_butler', 1090 '--logdog-bin-cmd', './../../bin/logdog_butler',
1099 '--project', 'chromium', 1091 '--project', 'chromium',
1100 '--service-account-json', 1092 '--service-account-json',
1101 '/creds/service_accounts/service-account-luci-logdog-publisher.json', 1093 '/creds/service_accounts/service-account-luci-logdog-publisher.json',
1102 '--prefix', 'android/swarming/logcats/${SWARMING_TASK_ID}', 1094 '--prefix', 'android/swarming/logcats/${SWARMING_TASK_ID}',
1103 '--source', '${ISOLATED_OUTDIR}/logcats', 1095 '--source', '${ISOLATED_OUTDIR}/logcats',
1104 '--name', 'unified_logcats', 1096 '--name', 'unified_logcats',
1105 ] 1097 ]
1106 test_cmdline = [ 1098 test_cmdline = [
1107 self.PathJoin('bin', 'run_%s' % target), 1099 self.PathJoin('bin', 'run_%s' % target),
1108 '--logcat-output-file', '${ISOLATED_OUTDIR}/logcats', 1100 '--logcat-output-file', '${ISOLATED_OUTDIR}/logcats',
1109 '--target-devices-file', '${SWARMING_BOT_FILE}', 1101 '--target-devices-file', '${SWARMING_BOT_FILE}',
1110 '-v' 1102 '-v'
1111 ] 1103 ]
1112 cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py'] 1104 cmdline = (['./../../build/android/test_wrapper/logdog_wrapper.py']
1113 + logdog_command + test_cmdline) 1105 + logdog_command + test_cmdline)
1114 elif use_x11 and test_type == 'windowed_test_launcher': 1106 elif use_x11 and test_type == 'windowed_test_launcher':
1115 extra_files = [ 1107 extra_files = [
1116 'xdisplaycheck', 1108 'xdisplaycheck',
1117 '../../testing/test_env.py', 1109 '../../testing/test_env.py',
1118 '../../testing/xvfb.py', 1110 '../../testing/xvfb.py',
1119 '../../third_party/gtest-parallel/gtest-parallel',
1120 ] 1111 ]
1121 cmdline = [ 1112 cmdline = [
1122 '../../testing/xvfb.py', 1113 '../../testing/xvfb.py',
1123 '.', 1114 '.',
1124 'python', 1115 './' + str(executable) + executable_suffix,
1125 '../../third_party/gtest-parallel/gtest-parallel', 1116 '--brave-new-test-launcher',
1126 ] + common_cmdline 1117 '--test-launcher-bot-mode',
1118 '--asan=%d' % asan,
1119 '--msan=%d' % msan,
1120 '--tsan=%d' % tsan,
1121 ]
1127 elif test_type in ('windowed_test_launcher', 'console_test_launcher'): 1122 elif test_type in ('windowed_test_launcher', 'console_test_launcher'):
1128 extra_files = [ 1123 extra_files = [
1129 '../../testing/test_env.py', 1124 '../../testing/test_env.py'
1130 '../../third_party/gtest-parallel/gtest-parallel',
1131 ] 1125 ]
1132 cmdline = [ 1126 cmdline = [
1133 '../../testing/test_env.py', 1127 '../../testing/test_env.py',
1134 'python', 1128 './' + str(executable) + executable_suffix,
1135 '../../third_party/gtest-parallel/gtest-parallel', 1129 '--brave-new-test-launcher',
1136 ] + common_cmdline 1130 '--test-launcher-bot-mode',
1137 elif test_type == 'non_parallel_console_test_launcher': 1131 '--asan=%d' % asan,
1132 '--msan=%d' % msan,
1133 '--tsan=%d' % tsan,
1134 ]
1135 elif test_type == 'gpu_browser_test':
1138 extra_files = [ 1136 extra_files = [
1137 '../../testing/test_env.py'
1138 ]
1139 gtest_filter = isolate_map[target]['gtest_filter']
1140 cmdline = [
1139 '../../testing/test_env.py', 1141 '../../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'
1140 ] 1151 ]
1141 cmdline = [ 1152 cmdline = [
1142 '../../testing/test_env.py', 1153 '../../testing/test_env.py',
1143 ] + common_cmdline 1154 '../../' + self.ToSrcRelPath(isolate_map[target]['script'])
1155 ]
1156 elif test_type in ('raw'):
1157 extra_files = []
1158 cmdline = [
1159 './' + str(target) + executable_suffix,
1160 ]
1161
1144 else: 1162 else:
1145 self.WriteFailureAndRaise('No command line for %s found (test type %s).' 1163 self.WriteFailureAndRaise('No command line for %s found (test type %s).'
1146 % (target, test_type), output_path=None) 1164 % (target, test_type), output_path=None)
1147 1165
1148 cmdline += isolate_map[target].get('args', []) 1166 cmdline += isolate_map[target].get('args', [])
1149 1167
1150 return cmdline, extra_files 1168 return cmdline, extra_files
1151 1169
1152 def ToAbsPath(self, build_path, *comps): 1170 def ToAbsPath(self, build_path, *comps):
1153 return self.PathJoin(self.chromium_src_dir, 1171 return self.PathJoin(self.chromium_src_dir,
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1553 # Then check to see if the arg contains any metacharacters other than 1571 # Then check to see if the arg contains any metacharacters other than
1554 # double quotes; if it does, quote everything (including the double 1572 # double quotes; if it does, quote everything (including the double
1555 # quotes) for safety. 1573 # quotes) for safety.
1556 if any(a in UNSAFE_FOR_CMD for a in arg): 1574 if any(a in UNSAFE_FOR_CMD for a in arg):
1557 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg) 1575 arg = ''.join('^' + a if a in ALL_META_CHARS else a for a in arg)
1558 return arg 1576 return arg
1559 1577
1560 1578
1561 if __name__ == '__main__': 1579 if __name__ == '__main__':
1562 sys.exit(main(sys.argv[1:])) 1580 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « third_party/gtest-parallel/gtest-parallel ('k') | tools/mb/mb_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698