Skip to content
This repository was archived by the owner on Dec 7, 2019. It is now read-only.

Commit 2ff3f57

Browse files
plastivartem-zinnatullin
authored andcommitted
Add support for AndroidX Test Orchestrator (#167)
Fixes #166
1 parent 984b64f commit 2ff3f57

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Composer shipped as jar, to run it you need JVM 1.8+: `java -jar composer-latest
120120
* `False` may be applicable when you run tests conditionally(via annotation/package filters) and empty suite is a valid outcome.
121121
* Example: `--fail-if-no-tests false`
122122
* `--with-orchestrator`
123-
* Either `true` or `false` to enable/disable running tests via Android Test Orchestrator.
123+
* Either `true` or `false` to enable/disable running tests via AndroidX Test Orchestrator.
124124
* Default: `false`.
125125
* When enabled - minimizes shared state and isolates test crashes.
126126
* Requires test orchestrator & test services APKs to be installed on device before executing.

composer/src/main/kotlin/com/gojuno/composer/Args.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ data class Args(
111111
@Parameter(
112112
names = arrayOf("--with-orchestrator"),
113113
required = false,
114-
description = "Either `true` or `false` to enable/disable running tests via Android Test Orchestrator. False by default.",
114+
arity = 1,
115+
description = "Either `true` or `false` to enable/disable running tests via AndroidX Test Orchestrator. False by default.",
115116
order = 12
116117
)
117118
var runWithOrchestrator: Boolean = false,

composer/src/main/kotlin/com/gojuno/composer/Main.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ private fun runAllTests(args: Args, testPackage: TestPackage.Valid, testRunner:
128128

129129
if (args.runWithOrchestrator) {
130130
targetInstrumentation = listOf("targetInstrumentation" to "${testPackage.value}/${testRunner.value}")
131-
testPackageName = "android.support.test.orchestrator"
132-
testRunnerClass = "android.support.test.orchestrator.AndroidTestOrchestrator"
131+
testPackageName = "androidx.test.orchestrator"
132+
testRunnerClass = "androidx.test.orchestrator.AndroidTestOrchestrator"
133133
} else {
134134
targetInstrumentation = emptyList()
135135
testPackageName = testPackage.value

composer/src/main/kotlin/com/gojuno/composer/TestRun.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fun AdbDevice.runTests(
5252
val logsDir = File(File(outputDir, "logs"), adbDevice.id)
5353
val instrumentationOutputFile = File(logsDir, "instrumentation.output")
5454
val commandPrefix = if (useTestServices) {
55-
"CLASSPATH=$(pm path android.support.test.services) app_process / android.support.test.services.shellexecutor.ShellMain "
55+
"CLASSPATH=$(pm path androidx.test.services) app_process / androidx.test.services.shellexecutor.ShellMain "
5656
} else ""
5757

5858
val runTests = process(

composer/src/test/kotlin/com/gojuno/composer/ArgsSpec.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class ArgsSpec : Spek({
199199
context("parse args with --with-orchestrator") {
200200

201201
val args by memoized {
202-
parseArgs(rawArgsWithOnlyRequiredFields + "--with-orchestrator")
202+
parseArgs(rawArgsWithOnlyRequiredFields + arrayOf("--with-orchestrator", "true"))
203203
}
204204

205205
it("parses --with-orchestrator correctly") {

0 commit comments

Comments
 (0)