Assigned
Status Update
Comments
ad...@google.com <ad...@google.com> #2
I tried adding screenshotTestImplementation(libs.androidx.window)
but it didn't fix it.
js...@google.com <js...@google.com>
xa...@google.com <xa...@google.com> #3
This is likely a duplicate of libs.androidx.window
dependency to implementation
to see if it works?
ar...@google.com <ar...@google.com> #4
No, I believe we can't do single FTL invocation with multiple APKs right now. But that would be a good solution. We'll follow up with FTL folks on this.
Description
However, this approach is costly on continuous integration. Cloud-based testing services such as Firebase Test Lab and Emulator.wtf have a minimum charge of 1 minute. This implies that running my tests on 70 modules effectively costs me a minimum of 70 minutes. I actually run tests on my min SDK and target SDK level, so I'm actually paying for 140 minutes for every CI job. The actual run time of all my tests is about 3 minutes, so the minimum per module is very high.
I'd like to reduce this cost, and one implementation might be to keep all my tests in their respective modules, but be able to merge them all together into a single test APK so that only two invocations to Firebase Test Lab are necessary (min and target SDK), using about 6 minutes of billable time total.
This isn't currently possible, although I hacked something together that gets me part way there: I created a new unifiedTestLib library project and added the src/androidTest/java directory of my other modules as a sourceSet of unifiedTestLib. This runs into a few issues:
- Kotlin internal and Java package-private code has to be made public. Workaround is more @VisibleForTesting annotations
- UI tests that relied on R don't compile, because the R class name is different in the original module versus the unifiedTestLib
- Tests that rely on BuildConfig don't compile, because the BuildCOnfig class name is also different
- Tests that rely on AndroidManifest entries in the androidTest source directory aren't available. This is often the case for abstract application components, where I need a concrete implementation to test against. E.g. ContentProvider, Activity, etc.