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
}
val batchSeed = labelsAndDirs.size / sbtInstances
val batchSize = if (batchSeed == 0) labelsAndDirs.size else batchSeed
labelsAndDirs
.grouped(batchSize)
.map { batch => () =>
IO.withTemporaryDirectory(runBatchedTests(batch, _, prescripted, log))
}
.toList
if (labelsAndDirs.isEmpty) List()
else {
val batchSeed = labelsAndDirs.size / sbtInstances
val batchSize = if (batchSeed == 0) labelsAndDirs.size else batchSeed
labelsAndDirs
.grouped(batchSize)
.map(batch => () => IO.withTemporaryDirectory(runBatchedTests(batch, _, prescripted, log)))
.toList
}
}
/** Defines an auto plugin that is injected to sbt between every scripted session.