Chromium Code Reviews| Index: tools/testing/perf_testing/run_perf_tests.py |
| diff --git a/tools/testing/perf_testing/run_perf_tests.py b/tools/testing/perf_testing/run_perf_tests.py |
| index 51f0b07cc12c7070c5bc594e0875a51a3e898a36..a97231f8efc950ac06133ba7b2cdb7c825c94360 100755 |
| --- a/tools/testing/perf_testing/run_perf_tests.py |
| +++ b/tools/testing/perf_testing/run_perf_tests.py |
| @@ -498,7 +498,7 @@ class BrowserStandalonePerformanceTest(PerformanceTest): |
| 'benchmark_page_%s.html' % version) |
| run_cmd(['python', os.path.join('tools', 'testing', 'run_selenium.py'), |
| '--out', file_path, '--browser', browser, |
| - '--timeout', '600', '--perf'], self.trace_file, append=True) |
| + '--timeout', '600', '--mode', 'perf'], self.trace_file, append=True) |
| def process_file(self, afile): |
| """Comb through the html to find the performance results.""" |
| @@ -594,7 +594,7 @@ class DromaeoTest(PerformanceTest): |
| 'index-js.html?%s' % version) |
| run_cmd(['python', os.path.join('tools', 'testing', 'run_selenium.py'), |
| '--out', file_path, '--browser', browser, |
| - '--timeout', '200', '--dromaeo'], self.trace_file, append=True) |
| + '--timeout', '200', '--mode', 'dromaeo'], self.trace_file, append=True) |
| def process_file(self, afile): |
| """Comb through the html to find the performance results.""" |
| @@ -853,24 +853,22 @@ class CompileTimeAndSizeTest(TestRunner): |
| 'Seconds', 10, 10, 'lower left', '2' + png_filename, [COMMAND_LINE], |
| [FROG], ['Bootstrapping', 'Compiling on Dart VM']) |
| +# TODO(vsm): Make these names consistent with BROWSER_PERF, CL_PERF, |
| +# etc. above. |
|
vsm
2012/04/04 18:09:02
Emily: I didn't change the names as it seems like
Emily Fortuna
2012/04/04 18:30:58
Don't worry about the old flag names. Change as yo
vsm
2012/04/04 20:05:09
Done.
|
| +SUITES = { |
| + 'command-line': CommandLinePerformanceTest, |
| + 'size-time': CompileTimeAndSizeTest, |
| + 'browser-perf': BrowserStandalonePerformanceTest, |
| + 'dromaeo': DromaeoTest, |
| + 'dromaeo-size': DromaeoSizeTest, |
| +} |
| + |
| def parse_args(): |
| parser = optparse.OptionParser() |
| # TODO(vsm): Change to a list to scale. |
| - parser.add_option('--command-line', '-c', dest='cl', |
| - help='Run the command line tests', |
| - action='store_true', default=False) |
| - parser.add_option('--size-time', '-s', dest='size', |
| - help='Run the code size and timing tests', |
| - action='store_true', default=False) |
| - parser.add_option('--browser-perf', '-b', dest='perf', |
| - help='Run the browser performance tests', |
| - action='store_true', default=False) |
| - parser.add_option('--dromaeo', '-d', dest='dromaeo', |
| - help='Run the Dromaeo performance tests', |
| - action='store_true', default=False) |
| - parser.add_option('--dromaeo-size', '-D', dest='dsize', |
| - help='Run the Dromaeo size tests', |
| - action='store_true', default=False) |
| + parser.add_option('--suites', '-s', dest='suites', |
| + help='Run the specified test suites', |
|
Emily Fortuna
2012/04/04 18:30:58
add "comma separated" and perhaps list the valid o
vsm
2012/04/04 20:05:09
Done.
|
| + action='store', default=None) |
| parser.add_option('--forever', '-f', dest='continuous', |
| help='Run this script forever, always checking for the next svn ' |
| 'checkin', action='store_true', default=False) |
| @@ -890,46 +888,48 @@ def parse_args(): |
| else: |
| print 'Warning: performance data will not be uploaded to App Engine' + \ |
| ' if you do not provide a username.' |
| - if not (args.cl or args.size or args.perf or args.dromaeo or args.dsize): |
| - args.cl = args.size = args.perf = args.dromaeo = args.dsize = True |
| - return (args.cl, args.size, args.perf, args.dromaeo, args.dsize, |
| - args.continuous, args.verbose, args.no_build, args.graph_only, |
| - args.username, password) |
| -def run_test_sequence(cl, size, perf, dromaeo, dsize, no_build, graph_only, |
| + if not args.suites: |
| + suites = SUITES.values() |
| + else: |
| + suites = [] |
| + suitelist = args.suites.split(',') |
| + for name in suitelist: |
| + if name in SUITES: |
| + suites.append(SUITES[name]) |
| + else: |
| + print 'Error: invalid suite %s' % name |
| + sys.exit(1) |
| + return (suites, args.continuous, args.verbose, args.no_build, |
| + args.graph_only, args.username, password) |
| + |
| +def run_test_sequence(suites, no_build, graph_only, |
| username, password): |
| # The buildbot already builds and syncs to a specific revision. Don't fight |
| # with it or replicate work. |
| if (not no_build or not graph_only) and sync_and_build() == 1: |
| return # The build is broken. |
| - if size: |
| - CompileTimeAndSizeTest().run(graph_only) |
| - if cl: |
| - CommandLinePerformanceTest().run(graph_only) |
| - if perf: |
| - BrowserStandalonePerformanceTest().run(graph_only) |
| - if dromaeo: |
| - DromaeoTest().run(graph_only) |
| - if dsize: |
| - DromaeoSizeTest().run(graph_only) |
| + |
| + for test in suites: |
| + test().run(graph_only) |
| if username != '': |
| upload_to_app_engine(username, password) |
| def main(): |
| global VERBOSE |
| - (cl, size, perf, dromaeo, dsize, continuous, verbose, no_build, graph_only, |
| - username, password) = parse_args() |
| + (suites, continuous, verbose, no_build, graph_only, |
| + username, password) = parse_args() |
|
Emily Fortuna
2012/04/04 18:30:58
can you move this back up to one line now?
vsm
2012/04/04 20:05:09
It doesn't fit in 80.
On 2012/04/04 18:30:58, Emi
|
| VERBOSE = verbose |
| if continuous: |
| while True: |
| if has_new_code(): |
| - run_test_sequence(cl, size, perf, dromaeo, dsize, no_build, graph_only, |
| + run_test_sequence(suites, no_build, graph_only, |
| username, password) |
| else: |
| time.sleep(SLEEP_TIME) |
| else: |
| - run_test_sequence(cl, size, perf, dromaeo, dsize, no_build, graph_only, |
| + run_test_sequence(suites, no_build, graph_only, |
| username, password) |
| if __name__ == '__main__': |