https://kotlinlang.org logo
#android
Title
# android
m

Mattia Tommasone

12/28/2020, 9:51 PM
Hello everyone, I haven’t really been writing Android code for years now so I’m not familiar with the Android ecosystem. I have a multi-target Kotlin project and i received a PR that converts all the Android tests to be executed with Robolectric rather than being executed on an actual, or emulated, device. Not being familiar with the ecosystem, I can’t say if it’s a safe choice or not. Any ideas on this? I know it’s a pretty vague question but I probably just need to gather some opinions on this
r

Ryan

12/28/2020, 10:02 PM
They want to take your instrumented tests and make them integration tests. I gave up on both of these tests and just use unit tests since personally I can’t keep up with writing for robolectric or devices.
Always felt like a chore to me to keep robolectric up to date.
2
l

Larry Schiefer

12/28/2020, 10:35 PM
Agreed - it can be tough to keep up with robo as well as devices, particularly when targeting newer Android versions and/or framework components. We tend to take a mixed approach - unit testing for most things and when we need to test something which relies on Android framework based classes we fall to robo first before trying to run on emulator or real device. But, admittedly, we lean this way since our apps tend to be those running on a custom Android for IoT device, not a commercial or stock Android build.
5 Views