diff --git a/test_runner/src/main/kotlin/ftl/args/CreateCommonArgs.kt b/test_runner/src/main/kotlin/ftl/args/CreateCommonArgs.kt index 773790796c..44b19a6d7e 100644 --- a/test_runner/src/main/kotlin/ftl/args/CreateCommonArgs.kt +++ b/test_runner/src/main/kotlin/ftl/args/CreateCommonArgs.kt @@ -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!!, @@ -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 diff --git a/test_runner/src/main/kotlin/ftl/args/IArgs.kt b/test_runner/src/main/kotlin/ftl/args/IArgs.kt index 0aaff382b8..1821994b88 100644 --- a/test_runner/src/main/kotlin/ftl/args/IArgs.kt +++ b/test_runner/src/main/kotlin/ftl/args/IArgs.kt @@ -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