Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py

Issue 2557673003: Change run_webkit_tests default order to random on Linux and Mac (Closed)
Patch Set: Attempt to fix unit test failures on Mac & Windows by specifying order Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2010 Google Inc. All rights reserved. 1 # Copyright (C) 2010 Google Inc. All rights reserved.
2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze ged 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze ged
3 # Copyright (C) 2011 Apple Inc. All rights reserved. 3 # Copyright (C) 2011 Apple Inc. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 default=0, 322 default=0,
323 help="Set the maximum number of locked shards"), 323 help="Set the maximum number of locked shards"),
324 optparse.make_option( 324 optparse.make_option(
325 "--nocheck-sys-deps", 325 "--nocheck-sys-deps",
326 action="store_true", 326 action="store_true",
327 default=False, 327 default=False,
328 help="Don't check the system dependencies (themes)"), 328 help="Don't check the system dependencies (themes)"),
329 optparse.make_option( 329 optparse.make_option(
330 "--order", 330 "--order",
331 action="store", 331 action="store",
332 default="natural", 332 # TODO(jeffcarp): platforms are moving to random-order by defaul t independently.
333 # See _set_up_derived_options below and crbug.com/601332.
334 default=("default"),
333 help=("Determine the order in which the test cases will be run. " 335 help=("Determine the order in which the test cases will be run. "
334 "'none' == use the order in which the tests were listed " 336 "'none' == use the order in which the tests were listed "
335 "either in arguments or test list, " 337 "either in arguments or test list, "
336 "'natural' == use the natural order (default), "
337 "'random' == pseudo-random order. Seed can be specified " 338 "'random' == pseudo-random order. Seed can be specified "
338 "via --seed, otherwise it will default to the current unix timestamp.")), 339 "via --seed, otherwise it will default to the current unix timestamp "
340 "(default on Mac & Linux). "
341 "'natural' == use the natural order (default on all others ).")),
339 optparse.make_option( 342 optparse.make_option(
340 "--profile", 343 "--profile",
341 action="store_true", 344 action="store_true",
342 help="Output per-test profile information."), 345 help="Output per-test profile information."),
343 optparse.make_option( 346 optparse.make_option(
344 "--profiler", 347 "--profiler",
345 action="store", 348 action="store",
346 help="Output per-test profile information, using the specified p rofiler."), 349 help="Output per-test profile information, using the specified p rofiler."),
347 optparse.make_option( 350 optparse.make_option(
348 "--repeat-each", 351 "--repeat-each",
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 options.skipped = 'default' 543 options.skipped = 'default'
541 544
542 if 'GTEST_SHARD_INDEX' in port.host.environ and 'GTEST_TOTAL_SHARDS' in port .host.environ: 545 if 'GTEST_SHARD_INDEX' in port.host.environ and 'GTEST_TOTAL_SHARDS' in port .host.environ:
543 shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) + 1 546 shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) + 1
544 total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) + 1 547 total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) + 1
545 options.run_part = '{0}:{1}'.format(shard_index, total_shards) 548 options.run_part = '{0}:{1}'.format(shard_index, total_shards)
546 549
547 if not options.seed: 550 if not options.seed:
548 options.seed = port.host.time() 551 options.seed = port.host.time()
549 552
553 # TODO(jeffcarp): This will be removed once all platforms move to random ord er.
554 # This must be here and not in parse_args because host is not instantiated y et there.
555 # See crbug.com/601332.
556 if options.order == 'default':
557 port_name = port.host.port_factory.get().port_name
558 if port_name.startswith(("linux-", "mac-")):
559 options.order = 'random'
560 else:
561 options.order = 'natural'
562
550 def _run_tests(port, options, args, printer): 563 def _run_tests(port, options, args, printer):
551 _set_up_derived_options(port, options, args) 564 _set_up_derived_options(port, options, args)
552 manager = Manager(port, options, printer) 565 manager = Manager(port, options, printer)
553 printer.print_config(port.results_directory()) 566 printer.print_config(port.results_directory())
554 return manager.run(args) 567 return manager.run(args)
555 568
556 569
557 def run(port, options, args, logging_stream, stdout): 570 def run(port, options, args, logging_stream, stdout):
558 logger = logging.getLogger() 571 logger = logging.getLogger()
559 logger.setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO ) 572 logger.setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO )
(...skipping 26 matching lines...) Expand all
586 _log.debug("\t%s", process) 599 _log.debug("\t%s", process)
587 600
588 return run_details 601 return run_details
589 602
590 finally: 603 finally:
591 printer.cleanup() 604 printer.cleanup()
592 605
593 if __name__ == '__main__': 606 if __name__ == '__main__':
594 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr) 607 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr)
595 sys.exit(exit_code) 608 sys.exit(exit_code)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698