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

Unified Diff: tools/test.py

Issue 6127003: Enable sharding of individual testsuites in tools/test.py... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/testcfg.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/test.py
===================================================================
--- tools/test.py (revision 6231)
+++ tools/test.py (working copy)
@@ -1181,6 +1181,12 @@
result.add_option("--crankshaft",
help="Run with the --crankshaft flag",
default=False, action="store_true")
+ result.add_option("--shard-count",
+ help="Split testsuites into this number of shards",
+ default=1, type="int")
+ result.add_option("--shard-run",
+ help="Run this shard from the split up tests.",
+ default=1, type="int")
result.add_option("--noprof", help="Disable profiling support",
default=False)
return result
@@ -1302,6 +1308,20 @@
millis = round(d * 1000) % 1000
return time.strftime("%M:%S.", time.gmtime(d)) + ("%03i" % millis)
+def ShardTests(tests, options):
+ if options.shard_count < 2:
+ return tests
+ if options.shard_run < 1 or options.shard_run > options.shard_count:
+ print "shard-run not a valid number, should be in [1:shard-count]"
+ print "defaulting back to running all tests"
+ return tests
+ count = 0;
+ shard = []
+ for test in tests:
+ if count % options.shard_count == options.shard_run - 1:
+ shard.append(test);
+ count += 1
+ return shard
def Main():
parser = BuildOptions()
@@ -1385,7 +1405,7 @@
globally_unused_rules = set(unused_rules)
else:
globally_unused_rules = globally_unused_rules.intersection(unused_rules)
- all_cases += cases
+ all_cases += ShardTests(cases, options)
all_unused.append(unused_rules)
if options.cat:
« no previous file with comments | « test/mjsunit/testcfg.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698