Chromium Code Reviews| Index: testing/scripts/run_locally_swarmed_webkit_layout_tests.py |
| diff --git a/testing/scripts/run_locally_swarmed_webkit_layout_tests.py b/testing/scripts/run_locally_swarmed_webkit_layout_tests.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..943f714d5891174fd1632617989af19bad6a0eff |
| --- /dev/null |
| +++ b/testing/scripts/run_locally_swarmed_webkit_layout_tests.py |
| @@ -0,0 +1,97 @@ |
| +#!/usr/bin/env python |
|
mithro
2017/01/31 23:51:42
This is emulating what the recipes code should be
Dirk Pranke
2017/02/01 01:32:51
Correct. This is a transitional script that I was
|
| +# Copyright 2015 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +import argparse |
| +import json |
| +import os |
| +import shutil |
| +import sys |
| +import tempfile |
| + |
| + |
| +import common |
| + |
| +# Add src/testing/ into sys.path for importing xvfb. |
| +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) |
| +import xvfb |
| + |
| + |
| +def main_run(args): |
| + os.chdir('src/out/Release') |
|
qyearsley
2017/01/13 01:09:12
Note, this doesn't matter, but when running this s
|
| + |
| + rc = common.run_command([ |
| + sys.executable, |
| + '../../tools/mb/mb.py', |
| + 'isolate', |
| + '//out/Release', |
| + 'webkit_layout_tests_exparchive', |
| + ]) |
| + if rc: |
| + return rc |
| + |
| + rc = common.run_command([ |
| + '../../tools/luci-go/linux64/isolate', |
| + 'exparchive', |
| + '-verbose', |
| + '-isolate=webkit_layout_tests_exparchive.isolate', |
| + '-isolated=webkit_layout_tests_exparchive.isolated', |
| + '-isolate-server=https://isolateserver.appspot.com', |
| + ]) |
| + if rc: |
| + return rc |
| + |
| + blamelist = os.environ.get('BUILDBOT_BLAMELIST', []) |
| + if (len(blamelist) == 1 and |
| + os.environ.get('BUILDBOT_MASTERNAME').startswith('tryserver')): |
| + user_args = ['--user', blamelist[0]] |
| + else: |
| + user_args = [] |
| + |
| + if isinstance(args.args, dict): |
| + num_shards = args.args.get('shards', 1) |
| + else: |
| + num_shards = 1 |
| + |
| + try: |
| + tmpdir = tempfile.mkdtemp('run_locally_swarmed_webkit_layout_tests_results', |
| + dir='.') |
| + rc = common.run_command([ |
| + sys.executable, |
| + '../../tools/swarming_client/swarming.py', |
| + 'run', |
| + '-v', |
| + ] + user_args + [ |
| + '-d', 'pool', 'Chrome', |
| + '-d', 'os', 'Ubuntu-12.04', |
| + '-d', 'gpu', 'none', |
| + '--swarming', 'https://chromium-swarm.appspot.com', |
| + '--isolate-server', 'https://isolateserver.appspot.com', |
| + '--shards', str(num_shards), |
| + '--task-output-dir', tmpdir, |
| + 'webkit_layout_tests_exparchive.isolated', |
| + '--', |
| + '--isolated-script-test-output', |
| + '${ISOLATED_OUTDIR}/output.json', |
| + ]) |
| + finally: |
| + # TODO: Merge the output and return real failures. |
| + shutil.rmtree(tmpdir, ignore_errors=True) |
| + |
| + json.dump({ |
| + 'valid': True, |
| + 'failures': ['Failure'] if rc else [], |
| + }, args.output) |
| + |
| + |
| +def main_compile_targets(args): |
| + json.dump(["locally_swarmed_webkit_layout_tests"], args.output) |
| + |
| + |
| +if __name__ == '__main__': |
| + funcs = { |
| + 'run': main_run, |
| + 'compile_targets': main_compile_targets, |
| + } |
| + sys.exit(common.run_script(sys.argv[1:], funcs)) |