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,14 +96,15 @@ final class ScriptedTests(resourceBaseDirectory: File,
(groupName, testName) -> testDirectory (groupName, testName) -> testDirectory
} }
val batchSeed = labelsAndDirs.size / sbtInstances if (labelsAndDirs.isEmpty) List()
val batchSize = if (batchSeed == 0) labelsAndDirs.size else batchSeed else {
labelsAndDirs val batchSeed = labelsAndDirs.size / sbtInstances
.grouped(batchSize) val batchSize = if (batchSeed == 0) labelsAndDirs.size else batchSeed
.map { batch => () => labelsAndDirs
IO.withTemporaryDirectory(runBatchedTests(batch, _, prescripted, log)) .grouped(batchSize)
} .map(batch => () => 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.