Install extra APKs if received ( useful for Orchestrator )#159
Install extra APKs if received ( useful for Orchestrator )#159artem-zinnatullin merged 6 commits intogojuno:masterfrom
Conversation
|
I made it more generic, now any APK used by tests: orchestrator, test-butler-app, ... can be installed what do you think @jonas-m- ? |
| val installApks: MutableCollection<Observable<Unit>> = mutableListOf(installAppApk, installTestApk) | ||
| if (args.runWithOrchestrator && args.orchestratorApks.isNotEmpty()) { | ||
| installApks.addAll(args.orchestratorApks.map { | ||
| if (args.extraApks.isNotEmpty()) { |
There was a problem hiding this comment.
Is this condition still needed?
It seems that if extraApks is empty then just nothing will be added in next line.
There was a problem hiding this comment.
You are absolutely right. I'll remove it.
|
@yunikkk ? |
Yep - looks good - liking the generic approach :) |
| val installTimeout = Pair(args.installTimeoutSeconds, TimeUnit.SECONDS) | ||
| val installAppApk = device.installApk(pathToApk = args.appApkPath, timeout = installTimeout) | ||
| val installTestApk = device.installApk(pathToApk = args.testApkPath, timeout = installTimeout) | ||
| val installApks: MutableCollection<Observable<Unit>> = mutableListOf(installAppApk, installTestApk) |
There was a problem hiding this comment.
nit: probably no need to specify type explicitly here?
README.md
Outdated
| * `--extra-apks` | ||
| * Apks to be installed for utilities. What you would typically declare in gradle as `androidTestUtil` | ||
| * Default: empty, only apk and test apk would be installed. | ||
| * Works great with orchestrator to install orchestrator & test services APKs. |
There was a problem hiding this comment.
nit: Orchestrator with capital O, can you please also make it a link to Android docs about it?
There was a problem hiding this comment.
The link is just two lines before this, on the --with-orchestrator flag.
|
What machanism is used to install apks to the device? (I assume commander houses that functionality). I gave instant run another try this last week (still terrible) and noticed it used a single adb command to push all the apk files in one go. Not sure it would make any difference but might be worth looking at? |
|
We use adb install if nothing changed. Instant run is not suitable for installs from scratch, it does push files and then uses tricks like custom classloader to hot swap to new stuff |
|
Guess ming13 added the merge permissions for you already... |
|
Yep! |
Now that we allow to use Orchestrator it would be nice to install the APKs required by Orchestrator to run.
Instead of being specific for Orchestrator this PR allows devs to install any extra APK they need.
There are no tests or documentation written yet because I want to validate the approach taken first, if it's ok I'll update the docs and add some tests ( suggestions on which ones are welcomed )