Merged test apk for dynamic feature modules

383 views Asked by At

Is there a way to create a universal APK for instrumented tests? I wanted to run the whole test suite on Firebase Test Lab but it seems tedious to upload one APK for each dynamic feature module's test APK.

For the app, you can do a packageVariantUniversalApk but you I can't seem to find any for the test APK.

Any help would be greatly appreciated.

1

There are 1 answers

0
vpuonti On

I've scoured the internet for an answer to this question and got here. It would seem that no, there is no way to create an universal androidTest APK from individual feature modules' instrumentation tests.

I'll probably look into creating an instrumentation test only library that depends on my app- and feature modules. https://developer.android.com/studio/test#use_separate_test_modules_for_instrumented_tests If I'm not mistaken, that should enable me to build a single test-APK that runs all the tests against the universal APK.

^That didn't work due to some manifest issues:

> Failed to calculate the value of task ':instrumentation:processVariantDebugManifest' property 'testedApplicationId'.
   > Collection has more than one element.

I guess we're stuck with running the tests module by module...