Skip to content

Commit bf81020

Browse files
committed
Merge branch 'main' into fix/flows_order
2 parents 9f6b747 + 9ad6e39 commit bf81020

30 files changed

Lines changed: 319 additions & 159 deletions

File tree

.github/workflows/test-e2e.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ on:
66

77
jobs:
88
build:
9-
name: Build
9+
name: Build on Java ${{ matrix.java-version }}
1010
runs-on: macos-latest
1111
timeout-minutes: 20
1212

13+
strategy:
14+
matrix:
15+
java-version: [11, 17]
16+
1317
steps:
1418
- name: Clone repository
1519
uses: actions/checkout@v4
@@ -18,7 +22,7 @@ jobs:
1822
uses: actions/setup-java@v4
1923
with:
2024
distribution: zulu
21-
java-version: 11
25+
java-version: ${{ matrix.java-version }}
2226
cache: gradle
2327

2428
- name: Build xctest-runner
@@ -29,7 +33,7 @@ jobs:
2933

3034
- uses: actions/upload-artifact@v4
3135
with:
32-
name: maestro-cli
36+
name: maestro-cli-jdk${{ matrix.java-version }}-run_id${{ github.run_id }}
3337
path: maestro-cli/build/distributions/maestro.zip
3438
retention-days: 1
3539

@@ -63,7 +67,7 @@ jobs:
6367
- name: Download artifacts
6468
uses: actions/download-artifact@v4
6569
with:
66-
name: maestro-cli
70+
name: maestro-cli-jdk11-run_id${{ github.run_id }}
6771

6872
- name: Add Maestro CLI executable to PATH
6973
run: |

.github/workflows/test.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66

77
jobs:
88
test:
9+
name: Test on Java ${{ matrix.java-version }}
910
runs-on: ubuntu-latest
1011

12+
strategy:
13+
matrix:
14+
java-version: [11, 17]
15+
1116
steps:
1217
- name: Clone repository
1318
uses: actions/checkout@v4
@@ -16,7 +21,7 @@ jobs:
1621
uses: actions/setup-java@v4
1722
with:
1823
distribution: zulu
19-
java-version: 11
24+
java-version: ${{ matrix.java-version }}
2025
cache: gradle
2126

2227
- name: Test

maestro-cli/src/main/java/maestro/cli/App.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class App {
7171
@Option(names = ["-v", "--version"], versionHelp = true, description = ["Display CLI version"])
7272
var requestedVersion: Boolean? = false
7373

74-
@Option(names = ["-p", "--platform"], hidden = true)
74+
@Option(names = ["-p", "--platform"], description = ["(Optional) Select a platform to run on"])
7575
var platform: String? = null
7676

7777
@Option(names = ["--host"], hidden = true)

maestro-cli/src/main/java/maestro/cli/command/CloudCommand.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import picocli.CommandLine.Option
3333
import java.io.File
3434
import java.util.concurrent.Callable
3535
import java.util.concurrent.TimeUnit
36+
import maestro.orchestra.util.Env.withDefaultEnvVars
3637

3738
@CommandLine.Command(
3839
name = "cloud",
@@ -172,6 +173,10 @@ class CloudCommand : Callable<Int> {
172173
}
173174
}
174175

176+
env = env
177+
.withInjectedShellEnvVars()
178+
.withDefaultEnvVars(flowsFile)
179+
175180
return CloudInteractor(
176181
client = ApiClient(apiUrl),
177182
failOnTimeout = failOnTimeout,
@@ -181,7 +186,7 @@ class CloudCommand : Callable<Int> {
181186
flowFile = flowsFile,
182187
appFile = appFile,
183188
mapping = mapping,
184-
env = env.withInjectedShellEnvVars(),
189+
env = env,
185190
uploadName = uploadName,
186191
repoOwner = repoOwner,
187192
repoName = repoName,

maestro-cli/src/main/java/maestro/cli/command/PrintHierarchyCommand.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class PrintHierarchyCommand : Runnable {
6363
port = parent?.port,
6464
driverHostPort = parent?.port,
6565
deviceId = parent?.deviceId,
66+
platform = parent?.platform,
6667
) { session ->
6768
Insights.onInsightsUpdated {
6869
val message = StringBuilder()

maestro-cli/src/main/java/maestro/cli/command/QueryCommand.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class QueryCommand : Runnable {
6767
host = parent?.host,
6868
port = parent?.port,
6969
driverHostPort = parent?.port,
70-
deviceId = parent?.deviceId
70+
deviceId = parent?.deviceId,
71+
platform = parent?.platform,
7172
) { session ->
7273
val filters = mutableListOf<ElementFilter>()
7374

maestro-cli/src/main/java/maestro/cli/command/RecordCommand.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import picocli.CommandLine
3535
import picocli.CommandLine.Option
3636
import java.io.File
3737
import java.util.concurrent.Callable
38+
import maestro.cli.device.Platform
3839

3940
@CommandLine.Command(
4041
name = "record",
@@ -76,19 +77,15 @@ class RecordCommand : Callable<Int> {
7677
)
7778
}
7879

79-
if (parent?.platform != null) {
80-
throw CliError("--platform option was deprecated. You can remove it to run your test.")
81-
}
82-
83-
8480
TestDebugReporter.install(debugOutputPathAsString = debugOutput, printToConsole = parent?.verbose == true)
8581
val path = TestDebugReporter.getDebugOutputPath()
8682

8783
return MaestroSessionManager.newSession(
8884
host = parent?.host,
8985
port = parent?.port,
9086
driverHostPort = parent?.port,
91-
deviceId = parent?.deviceId
87+
deviceId = parent?.deviceId,
88+
platform = parent?.platform,
9289
) { session ->
9390
val maestro = session.maestro
9491
val device = session.device

maestro-cli/src/main/java/maestro/cli/command/StudioCommand.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ class StudioCommand : Callable<Int> {
4646
private var noWindow: Boolean? = null
4747

4848
override fun call(): Int {
49-
if (parent?.platform != null) {
50-
throw CliError("--platform option was deprecated. You can remove it to run your test.")
51-
}
5249

5350
TestDebugReporter.install(debugOutputPathAsString = debugOutput, printToConsole = parent?.verbose == true)
5451

@@ -57,6 +54,7 @@ class StudioCommand : Callable<Int> {
5754
port = parent?.port,
5855
driverHostPort = parent?.port,
5956
deviceId = parent?.deviceId,
57+
platform = parent?.platform,
6058
isStudio = true
6159
) { session ->
6260
val port = getFreePort()

0 commit comments

Comments
 (0)