gojuno / composer

Reactive Android Instrumentation Test Runner. Archived. Marathon is recommended as an alternative (https://github.com/Malinskiy/marathon).
Apache License 2.0
546 stars 45 forks source link

Multiple instrumentation arguments stuck at `Starting tests...` #107

Closed trevjonez closed 6 years ago

trevjonez commented 6 years ago

v0.2.7 is still locking up at Starting tests...

when invoking with: --instrumentation-arguments screenshotsDisabled false screenshotsEngine uiAutomator

verbose out lists it as: instrumentationArguments=[screenshotsDisabled false screenshotsEngine uiAutomator]

this matches exactly the current example in the readme --instrumentation-arguments key1 value1 key2 value2

yunikkk commented 6 years ago

Well, multiple --instrumentation-arguments separated with spaces should not be the reason, they worked even before. In #96 I only fixed the commas, which were incorrectly splitting arguments once more... Could you please show the full command you use to launch composer?

trevjonez commented 6 years ago
--apk /private/var/folders/b3/tcpv30vn7f51q38m56vk3fsw0000gn/T/junit8890537050222603869/vanilla/build/outputs/apk/debug/vanilla-debug.apk \
--test-apk /private/var/folders/b3/tcpv30vn7f51q38m56vk3fsw0000gn/T/junit8890537050222603869/vanilla/build/outputs/apk/androidTest/debug/vanilla-debug-androidTest.apk \
--test-package com.trevjonez.example.test \
--test-runner android.support.test.runner.AndroidJUnitRunner \
--output-directory /private/var/folders/b3/tcpv30vn7f51q38m56vk3fsw0000gn/T/junit8890537050222603869/vanilla/build/reports/composer/debug \
--instrumentation-arguments screenshotsDisabled false screenshotsEngine uiAutomator \
--verbose-output true \
--devices emulator-5554 \
--keep-output-on-exit

which prints as

Args(appApkPath=/private/var/folders/b3/tcpv30vn7f51q38m56vk3fsw0000gn/T/junit8890537050222603869/vanilla/build/outputs/apk/debug/vanilla-debug.apk, testApkPath=/private/var/folders/b3/tcpv30vn7f51q38m56vk3fsw0000gn/T/junit8890537050222603869/vanilla/build/outputs/apk/androidTest/debug/vanilla-debug-androidTest.apk, testPackage=com.trevjonez.example.test, testRunner=android.support.test.runner.AndroidJUnitRunner, shard=true, outputDirectory=/private/var/folders/b3/tcpv30vn7f51q38m56vk3fsw0000gn/T/junit8890537050222603869/vanilla/build/reports/composer/debug, instrumentationArguments=[screenshotsDisabled false screenshotsEngine uiAutomator], verboseOutput=true, keepOutputOnExit=true, devices=[emulator-5554], devicePattern=)
yunikkk commented 6 years ago

Ah, the issue should be that instrumentation-arguments are joined to string in https://github.com/trevjonez/composer-gradle-plugin/blob/master/core/src/main/kotlin/com/trevjonez/composer/ComposerConfiguration.kt#L51, it.joinToString(separator = " ") { "${it.first} ${it.second}" }). Then they are treated as a single argument further, too.

Not sure what the proper fix should be. We could probably split em, too. Terminal usage implies that, and running composer from cli automatically does that.

trevjonez commented 6 years ago

I am adjusting on my end. looks to work as expected now. probably had the same or similar issue in the --devices portion of the same method.

reported from verbose output now as instrumentationArguments=[screenshotsDisabled, false, screenshotsEngine, uiAutomator]

trevjonez commented 6 years ago

https://github.com/trevjonez/composer-gradle-plugin/releases/tag/0.4.1

Thanks for checking me on that. Such a duh on my end.