Switch Swarming commands to py3.

Thanks to machenbach@ for the heads up.

WebRTC's MB was generating a Swarming command that was using vpython
(defaulting on python2 on some platforms). This CL switches that to
vpython3 (fixing gtest-parallel-wrapper.py to be python3 compliant).

No-Presubmit: True
Bug: webrtc:13607
Change-Id: Icfa7d23b81e30cebfe8243d4ba65284955593465
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249604
Reviewed-by: Christoffer Jansson <jansson@google.com>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35821}
This commit is contained in:
Mirko Bonadei
2022-01-27 20:18:16 +01:00
committed by WebRTC LUCI CQ
parent 9153f71a3f
commit 5d9ae8635c
3 changed files with 26 additions and 26 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env vpython3
# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
#
@ -226,7 +226,7 @@ def main():
if test_artifacts_dir and not os.path.isdir(test_artifacts_dir):
os.makedirs(test_artifacts_dir)
print 'gtest-parallel-wrapper: Executing command %s' % ' '.join(command)
print('gtest-parallel-wrapper: Executing command %s' % ' '.join(command))
sys.stdout.flush()
exit_code = subprocess.call(command, env=test_env, cwd=os.getcwd())

View File

@ -919,10 +919,10 @@ class MetaBuildWrapper(object):
cmdline = []
extra_files = [
'../../.vpython',
'../../.vpython3',
'../../testing/test_env.py',
]
vpython_exe = 'vpython'
vpython_exe = 'vpython3'
must_retry = False
if test_type == 'script':

View File

@ -350,10 +350,10 @@ class UnitTest(unittest.TestCase):
files = isolate_file_contents['variables']['files']
command = isolate_file_contents['variables']['command']
self.assertEqual(files, ['../../.vpython', '../../testing/test_env.py',
self.assertEqual(files, ['../../.vpython3', '../../testing/test_env.py',
'base_unittests'])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../build/android/test_wrapper/logdog_wrapper.py',
'--target',
'base_unittests',
@ -389,10 +389,10 @@ class UnitTest(unittest.TestCase):
files = isolate_file_contents['variables']['files']
command = isolate_file_contents['variables']['command']
self.assertEqual(files, ['../../.vpython', '../../testing/test_env.py',
self.assertEqual(files, ['../../.vpython3', '../../testing/test_env.py',
'base_unittests'])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../build/android/test_wrapper/logdog_wrapper.py',
'--target',
'base_unittests',
@ -430,7 +430,7 @@ class UnitTest(unittest.TestCase):
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../.vpython',
'../../.vpython3',
'../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
@ -438,7 +438,7 @@ class UnitTest(unittest.TestCase):
'base_unittests',
])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../testing/test_env.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=${ISOLATED_OUTDIR}/test_logs',
@ -483,11 +483,11 @@ class UnitTest(unittest.TestCase):
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../.vpython', '../../testing/test_env.py',
'../../.vpython3', '../../testing/test_env.py',
'base_unittests', 'base_unittests_script.py',
])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../base/base_unittests_script.py',
])
@ -517,15 +517,15 @@ class UnitTest(unittest.TestCase):
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../.vpython',
'../../.vpython3',
'../../testing/test_env.py',
'../../tools_webrtc/flags_compatibility.py',
'base_unittests',
])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../tools_webrtc/flags_compatibility.py',
'vpython',
'vpython3',
'../../testing/test_env.py',
'./base_unittests',
'--asan=0',
@ -560,7 +560,7 @@ class UnitTest(unittest.TestCase):
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../.vpython',
'../../.vpython3',
'../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
@ -568,7 +568,7 @@ class UnitTest(unittest.TestCase):
'base_unittests',
])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../testing/test_env.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=${ISOLATED_OUTDIR}/test_logs',
@ -611,7 +611,7 @@ class UnitTest(unittest.TestCase):
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../.vpython',
'../../.vpython3',
'../../testing/test_env.py',
'../../testing/xvfb.py',
'../../third_party/gtest-parallel/gtest-parallel',
@ -621,7 +621,7 @@ class UnitTest(unittest.TestCase):
'some_resource_file',
])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../testing/xvfb.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=${ISOLATED_OUTDIR}/test_logs',
@ -665,7 +665,7 @@ class UnitTest(unittest.TestCase):
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../.vpython',
'../../.vpython3',
'../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
@ -674,7 +674,7 @@ class UnitTest(unittest.TestCase):
'unittests.exe',
])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../testing/test_env.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=${ISOLATED_OUTDIR}\\test_logs',
@ -715,7 +715,7 @@ class UnitTest(unittest.TestCase):
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../.vpython',
'../../.vpython3',
'../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
@ -723,7 +723,7 @@ class UnitTest(unittest.TestCase):
'base_unittests',
])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../testing/test_env.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=${ISOLATED_OUTDIR}/test_logs',
@ -766,7 +766,7 @@ class UnitTest(unittest.TestCase):
command = isolate_file_contents['variables']['command']
self.assertEqual(files, [
'../../.vpython',
'../../.vpython3',
'../../testing/test_env.py',
'../../third_party/gtest-parallel/gtest-parallel',
'../../third_party/gtest-parallel/gtest_parallel.py',
@ -776,9 +776,9 @@ class UnitTest(unittest.TestCase):
'some_resource_file',
])
self.assertEqual(command, [
'vpython',
'vpython3',
'../../tools_webrtc/ensure_webcam_is_running.py',
'vpython',
'vpython3',
'../../testing/test_env.py',
'../../tools_webrtc/gtest-parallel-wrapper.py',
'--output_dir=${ISOLATED_OUTDIR}/test_logs',