Skip to content

Commit

Permalink
Improve shard debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
bootstraponline committed Jul 9, 2019
1 parent 480cd14 commit 4a71276
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test_runner/src/main/kotlin/ftl/shard/Shard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package ftl.shard

import ftl.args.AndroidArgs
import ftl.args.IArgs
import ftl.args.IosArgs
import ftl.reports.xml.model.JUnitTestCase
import ftl.reports.xml.model.JUnitTestResult
import ftl.util.Utils.fatalError
import kotlin.math.roundToInt

data class TestMethod(
Expand Down Expand Up @@ -104,6 +106,17 @@ object Shard {
val shardsCount = if (maxShards == -1 || maxShards > testCount) testCount else maxShards

// Create the list of shards we will return
if (shardsCount <= 0) {
val platform = if (args is IosArgs) "ios" else "android"
fatalError(
"""Invalid shard count. To debug try: flank $platform run --dump-shards
| args.maxTestShards: ${args.maxTestShards}
| forcedShardCount: $forcedShardCount
| testCount: $testCount
| maxShards: $maxShards
| shardsCount: $shardsCount""".trimMargin()
)
}
var shards = List(shardsCount) { TestShard(0.0, mutableListOf()) }

// We want to iterate over testcase going from slowest to fastest
Expand Down

0 comments on commit 4a71276

Please sign in to comment.