Commit 7601854d authored by Alexander Schulze's avatar Alexander Schulze Committed by V8 LUCI CQ

[v8] py3 migration of tools/predictable_wrapper.py

Migrate predictable_wrapper to py3. Run test in v8_presubmit.

R=liviurau@chromium.org, machenbach@chromium.org

Bug: chromium:1245634
Change-Id: I941e248ffcf12ce26a55a5f5889dab06ee74e66e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3448379Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarLiviu Rau <liviurau@chromium.org>
Commit-Queue: Alexander Schulze <alexschulze@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79200}
parent 17536f94
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......@@ -31,10 +31,16 @@ TIMEOUT = 120
# Predictable mode works only when run on the host os.
command.setup(utils.GuessOS(), None)
def maybe_decode(message):
if not isinstance(message, str):
return message.decode()
return message
def main(args):
def allocation_str(stdout):
for line in reversed((stdout or '').splitlines()):
if line.startswith('### Allocations = '):
if maybe_decode(line).startswith('### Allocations = '):
return line
return None
......
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
#!/usr/bin/env python
#!/usr/bin/env python3
# Copyright 2017 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......
......@@ -743,6 +743,7 @@ def PyTests(workspace):
for script in [
join(workspace, 'tools', 'clusterfuzz', 'foozzie', 'v8_foozzie_test.py'),
join(workspace, 'tools', 'release', 'test_scripts.py'),
join(workspace, 'tools', 'unittests', 'predictable_wrapper_test.py'),
join(workspace, 'tools', 'unittests', 'run_tests_test.py'),
join(workspace, 'tools', 'unittests', 'run_perf_test.py'),
join(workspace, 'tools', 'testrunner', 'testproc', 'variant_unittest.py'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment