Skip to content

Commit

Permalink
Rename broadcast to replicate
Browse files Browse the repository at this point in the history
  • Loading branch information
tokou authored and bartekpacia committed Sep 2, 2024
1 parent a329bb0 commit fadf7a7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions maestro-cli/src/main/java/maestro/cli/command/TestCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ class TestCommand : Callable<Int> {
private var shards: Int = 1

@Option(
names = ["-b", "--broadcast"],
description = ["Broadcasts all the tests across all running devices"]
names = ["-r", "--replicate"],
description = ["Replicates all the tests across all running devices"]
)
private var broadcast: Boolean = false
private var replicate: Boolean = false

@Option(names = ["-c", "--continuous"])
private var continuous: Boolean = false
Expand Down Expand Up @@ -201,11 +201,11 @@ class TestCommand : Callable<Int> {
}.toMutableSet())

val availableDevices = if (deviceIds.isNotEmpty()) deviceIds.size else initialActiveDevices.size
val effectiveShards = if (broadcast) availableDevices else shards.coerceAtMost(plan.flowsToRun.size)
val effectiveShards = if (replicate) availableDevices else shards.coerceAtMost(plan.flowsToRun.size)
val sharded = effectiveShards > 1

val chunkPlans =
if (broadcast) (0 until availableDevices).map { ExecutionPlan(plan.flowsToRun, plan.sequence) }
if (replicate) (0 until availableDevices).map { ExecutionPlan(plan.flowsToRun, plan.sequence) }
else plan.flowsToRun
.withIndex()
.groupBy { it.index % effectiveShards }
Expand All @@ -221,7 +221,7 @@ class TestCommand : Callable<Int> {

// Collect device configurations for missing shards, if any
val missing = effectiveShards - availableDevices
val allDeviceConfigs = if (!broadcast) (0 until missing).map { shardIndex ->
val allDeviceConfigs = if (!replicate) (0 until missing).map { shardIndex ->
PrintUtils.message("------------------ Shard ${shardIndex + 1} ------------------")
// Collect device configurations here, one per shard
PickDeviceView.requestDeviceOptions()
Expand Down

0 comments on commit fadf7a7

Please sign in to comment.