I'm testing my Android app with Robolectric but I faced a weird situation. What happens is that when I run some set of tests, the first test ran with Robolectric takes much more time than any other test. It is not specific from the test itself, since I tried different configurations on the order of the tests and the result is that the first test is always the slowest.
Is it any Robolectric setup time or something like that? Any information provided is useful.
For example:
Yes, this is setup time. Unfortunately there are no central place where you can gather all information about Robolectric
.
Watch this presentation and you will find more explanations on pages 28, 29, 30, 35.
If you're interested the Robolectric
changed some approaches in version 2.0. Significant changes are:
Javaassist
usage replaced with ASM
usage - for speedup start timeIf you use gradle
then take a look also on robolectric gradle plugin. The added running tests in parallel and other tuning options. The running tests in parallel apparently useful only with big amount of tests (hundreds+)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With