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

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

Issue 2591933002: Make run_webkit_tests random order by default for all platforms (Closed)
Patch Set: Created 3 years, 12 months 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 | no next file » | 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 # TODO(jeffcarp): platforms are moving to random-order by defaul t independently. 332 default=("random"),
qyearsley 2016/12/20 23:58:06 Nit: No need for parentheses here.
333 # See _set_up_derived_options below and crbug.com/601332.
334 default=("default"),
335 help=("Determine the order in which the test cases will be run. " 333 help=("Determine the order in which the test cases will be run. "
336 "'none' == use the order in which the tests were listed " 334 "'none' == use the order in which the tests were listed "
337 "either in arguments or test list, " 335 "either in arguments or test list, "
338 "'random' == pseudo-random order. Seed can be specified " 336 "'random' == pseudo-random order (default). Seed can be sp ecified "
339 "via --seed, otherwise it will default to the current unix timestamp " 337 "via --seed, otherwise it will default to the current unix timestamp. "
340 "(default on Mac & Linux). " 338 "'natural' == use the natural order")),
341 "'natural' == use the natural order (default on all others ).")),
342 optparse.make_option( 339 optparse.make_option(
343 "--profile", 340 "--profile",
344 action="store_true", 341 action="store_true",
345 help="Output per-test profile information."), 342 help="Output per-test profile information."),
346 optparse.make_option( 343 optparse.make_option(
347 "--profiler", 344 "--profiler",
348 action="store", 345 action="store",
349 help="Output per-test profile information, using the specified p rofiler."), 346 help="Output per-test profile information, using the specified p rofiler."),
350 optparse.make_option( 347 optparse.make_option(
351 "--repeat-each", 348 "--repeat-each",
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 options.skipped = 'default' 540 options.skipped = 'default'
544 541
545 if 'GTEST_SHARD_INDEX' in port.host.environ and 'GTEST_TOTAL_SHARDS' in port .host.environ: 542 if 'GTEST_SHARD_INDEX' in port.host.environ and 'GTEST_TOTAL_SHARDS' in port .host.environ:
546 shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) + 1 543 shard_index = int(port.host.environ['GTEST_SHARD_INDEX']) + 1
547 total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) + 1 544 total_shards = int(port.host.environ['GTEST_TOTAL_SHARDS']) + 1
548 options.run_part = '{0}:{1}'.format(shard_index, total_shards) 545 options.run_part = '{0}:{1}'.format(shard_index, total_shards)
549 546
550 if not options.seed: 547 if not options.seed:
551 options.seed = port.host.time() 548 options.seed = port.host.time()
552 549
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
563 def _run_tests(port, options, args, printer): 550 def _run_tests(port, options, args, printer):
564 _set_up_derived_options(port, options, args) 551 _set_up_derived_options(port, options, args)
565 manager = Manager(port, options, printer) 552 manager = Manager(port, options, printer)
566 printer.print_config(port.results_directory()) 553 printer.print_config(port.results_directory())
567 return manager.run(args) 554 return manager.run(args)
568 555
569 556
570 def run(port, options, args, logging_stream, stdout): 557 def run(port, options, args, logging_stream, stdout):
571 logger = logging.getLogger() 558 logger = logging.getLogger()
572 logger.setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO ) 559 logger.setLevel(logging.DEBUG if options.debug_rwt_logging else logging.INFO )
(...skipping 26 matching lines...) Expand all
599 _log.debug("\t%s", process) 586 _log.debug("\t%s", process)
600 587
601 return run_details 588 return run_details
602 589
603 finally: 590 finally:
604 printer.cleanup() 591 printer.cleanup()
605 592
606 if __name__ == '__main__': 593 if __name__ == '__main__':
607 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr) 594 exit_code = main(sys.argv[1:], sys.stdout, sys.stderr)
608 sys.exit(exit_code) 595 sys.exit(exit_code)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698