Skip to content

Commit

Permalink
Fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-goral committed Jun 3, 2020
1 parent d10c9aa commit f17715f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 6 additions & 1 deletion test_runner/src/main/kotlin/ftl/args/CreateCommonArgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fun CommonConfig.createCommonArgs(
clientDetails = gcloud.clientDetails,

// flank
maxTestShards = flank.maxTestShards!!,
maxTestShards = convertToShardCount(flank.maxTestShards!!),
shardTime = flank.shardTime!!,
repeatTests = flank.repeatTests!!,
smartFlankGcsPath = flank.smartFlankGcsPath!!,
Expand Down Expand Up @@ -58,3 +58,8 @@ private val CommonConfig.defaultOutputStyle
private val CommonConfig.hasMultipleExecutions
get() = gcloud.flakyTestAttempts!! > 0 ||
(!flank.disableSharding!! && flank.maxTestShards!! > 0)

fun convertToShardCount(inputValue: Int): Int =
if (inputValue != -1)
inputValue else
IArgs.AVAILABLE_SHARD_COUNT_RANGE.last
6 changes: 0 additions & 6 deletions test_runner/src/main/kotlin/ftl/args/IArgs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,6 @@ interface IArgs {

fun useLocalResultDir() = localResultDir != defaultLocalResultsDir

fun convertToShardCount(inputValue: Int): Int = if (inputValue == -1) {
AVAILABLE_SHARD_COUNT_RANGE.last
} else {
inputValue
}

companion object {
// num_shards must be >= 1, and <= 50
val AVAILABLE_SHARD_COUNT_RANGE = 1..50
Expand Down

0 comments on commit f17715f

Please sign in to comment.