| Index: tools/testing/dart/test_suite.dart
|
| ===================================================================
|
| --- tools/testing/dart/test_suite.dart (revision 5977)
|
| +++ tools/testing/dart/test_suite.dart (working copy)
|
| @@ -245,22 +245,6 @@
|
| // this suite.
|
| if (!testCache.containsKey(suiteName)) {
|
| cachedTests = testCache[suiteName] = [];
|
| - if (configuration['shards'] > 1) {
|
| - // If we are sharding tests, we do not enqueue them as they are
|
| - // found in the directory listing. We add all the tests to the
|
| - // testCache, then delete all but this shard's tests from the
|
| - // cache. The doDone function then enqueues the tests from the
|
| - // cache, and other configurations also use the shard from the
|
| - // cache.
|
| - Function oldDone = doDone;
|
| - doDone = () {
|
| - testCache[suiteName] = shardTests();
|
| - for (var info in testCache[suiteName]) {
|
| - enqueueTestCaseFromTestInformation(info);
|
| - }
|
| - oldDone();
|
| - };
|
| - }
|
| processDirectory();
|
| } else {
|
| // We rely on enqueueing completing asynchronously so use a
|
| @@ -396,6 +380,14 @@
|
| bool hasFatalTypeErrors = false,
|
| bool hasRuntimeErrors = false,
|
| Set<String> multitestOutcome = null]) {
|
| + int shards = configuration['shards'];
|
| + if (shards > 1) {
|
| + int shard = configuration['shard'];
|
| + if (filename.hashCode() % shards != shard -1) {
|
| + return;
|
| + }
|
| + }
|
| +
|
| // Cache the test information for each test case.
|
| var info = new TestInformation(filename,
|
| optionsFromFile,
|
| @@ -405,10 +397,7 @@
|
| hasRuntimeErrors,
|
| multitestOutcome);
|
| cachedTests.add(info);
|
| - if (configuration['shards'] == 1) {
|
| - // If we are not sharding, we queue the tests as we find them.
|
| - enqueueTestCaseFromTestInformation(info);
|
| - }
|
| + enqueueTestCaseFromTestInformation(info);
|
| };
|
| }
|
|
|
| @@ -891,24 +880,6 @@
|
| "numStaticTypeAnnotations": numStaticTypeAnnotations,
|
| "numCompileTimeAnnotations": numCompileTimeAnnotations};
|
| }
|
| -
|
| - /**
|
| - * shardTests takes the list of tests, stored as the List<TestInformation>
|
| - * cachedTests, and selects only the tests belonging to this shard.
|
| - * The tests are sorted by filename, and if there are n shards and we are
|
| - * shard number i, only the tests at indices equal to i-1 modulo n are kept.
|
| - */
|
| - List<TestInformation> shardTests() {
|
| - cachedTests.sort((TestInformation a, TestInformation b) => a.filename.compareTo(b.filename));
|
| - int n = configuration['shards'];
|
| - int i = configuration['shard'];
|
| - if (n >= 2) {
|
| - int current = 0;
|
| - // The test function given to cachedTests.filter uses the entry's index.
|
| - cachedTests = cachedTests.filter((t) => ((++current % n) == i - 1));
|
| - }
|
| - return cachedTests;
|
| - }
|
| }
|
|
|
|
|
|
|