summaryrefslogtreecommitdiffstats
path: root/build/android/bb_run_sharded_steps.py
blob: 6aeba5b5f58cfeccf7d835e6613afbb632ea18b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
#
# Copyright (c) 2012 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.

"""DEPRECATED!
TODO(bulach): remove me once all other repositories reference
'test_runner.py perf' directly.
"""

import optparse
import sys

from pylib import cmd_helper


def main(argv):
  parser = optparse.OptionParser()
  parser.add_option('-s', '--steps',
                    help='A JSON file containing all the steps to be '
                         'sharded.')
  parser.add_option('--flaky_steps',
                    help='A JSON file containing steps that are flaky and '
                         'will have its exit code ignored.')
  parser.add_option('-p', '--print_results',
                    help='Only prints the results for the previously '
                         'executed step, do not run it again.')
  options, _ = parser.parse_args(argv)
  if options.print_results:
    return cmd_helper.RunCmd(['build/android/test_runner.py', 'perf',
                              '--print-step', options.print_results])
  flaky_options = []
  if options.flaky_steps:
    flaky_options = ['--flaky-steps', options.flaky_steps]
  return cmd_helper.RunCmd(['build/android/test_runner.py', 'perf', '-v',
                            '--steps', options.steps] + flaky_options)


if __name__ == '__main__':
  sys.exit(main(sys.argv))