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

--with-orchestrator is not working as expected #158

Closed CristianGM closed 5 years ago

CristianGM commented 5 years ago

The documentation says the argument should be true or false but it's not true:

$ java -jar composer.jar --apk /any/path/debug-androidTest.apk --test-apk /any/path/debug-androidTest.apk --output-directory /any/path --verbose-output true --with-orchestrator true
Exception in thread "main" com.beust.jcommander.ParameterException: Was passed main parameter 'true' but no main parameter was defined in your arg class
        at com.beust.jcommander.JCommander.getMainParameter(JCommander.java:887)
        at com.beust.jcommander.JCommander.parseValues(JCommander.java:705)
        at com.beust.jcommander.JCommander.parse(JCommander.java:312)
        at com.beust.jcommander.JCommander.parse(JCommander.java:291)
        at com.gojuno.composer.ArgsKt.parseArgs(Args.kt:138)
        at com.gojuno.composer.MainKt.main(Main.kt:34)

( I removed the paths of the apk because they are irrelevant )

as soon as I remove the last true from the command it works as a charm

I was going to open the PR to the gradle plugin adding it, but now I don't know what should I do.

any comment to add @jonas-m- ? Am I missing something?

jonas-m- commented 5 years ago

Will try to take a look in ~5 hours, but it seems that it's an error in documentation only.

Will reply as soon as I have an answer

jonas-m- commented 5 years ago

Confirmed: just a problem with documentation.

In my PR, I've based my argument documentation on an existing --keep-output-on-exit. And sure enough - just checked - it also doesn't behave as documented: presence of the parameter flag itself acts as true, without it accepting any arguments

CristianGM commented 5 years ago

Then fixing the documentation would close this issue. Thanks for checking it!

CristianGM commented 5 years ago

it may be a different issue, but we are missing the clearPackageData so just orchestrator is not enough for us

plastiv commented 5 years ago

it may be a different issue, but we are missing the clearPackageData so just orchestrator is not enough for us

clearPackageData as instrumentation runner argument is supported by composer without changes already:

java -jar composer-latest-version.jar \
--apk app/build/outputs/apk/example-debug.apk \
--test-apk app/build/outputs/apk/example-debug-androidTest.apk \
--instrumentation-arguments clearPackageData true \
--with-orchestrator true