Handle empty case in `labelsAndDirs`

This commit is contained in:
jvican 2017-05-02 21:10:48 +02:00
parent 5e44ec7c53
commit 3d6e0f9327
No known key found for this signature in database
GPG Key ID: 42DAFA0F112E8050
1 changed files with 9 additions and 8 deletions

View File

@ -96,15 +96,16 @@ final class ScriptedTests(resourceBaseDirectory: File,
(groupName, testName) -> testDirectory (groupName, testName) -> testDirectory
} }
if (labelsAndDirs.isEmpty) List()
else {
val batchSeed = labelsAndDirs.size / sbtInstances val batchSeed = labelsAndDirs.size / sbtInstances
val batchSize = if (batchSeed == 0) labelsAndDirs.size else batchSeed val batchSize = if (batchSeed == 0) labelsAndDirs.size else batchSeed
labelsAndDirs labelsAndDirs
.grouped(batchSize) .grouped(batchSize)
.map { batch => () => .map(batch => () => IO.withTemporaryDirectory(runBatchedTests(batch, _, prescripted, log)))
IO.withTemporaryDirectory(runBatchedTests(batch, _, prescripted, log))
}
.toList .toList
} }
}
/** Defines an auto plugin that is injected to sbt between every scripted session. /** Defines an auto plugin that is injected to sbt between every scripted session.
* *