Hey folks! Curious if you are all experiencing in...
# multiplatform
i
Hey folks! Curious if you are all experiencing incredibly slow tests. Mine take over 2 minutes to complete and most of that seems to be the build cycle. Has anyone figured out how to get tests running a bit quicker?
m
It really depends what you are doing, how your tests are made, how many targets you have and of course how your production code looks. In general - less is more!
m
Native tests are slow, especially if you have multiple targets. There's no silver bullet. If you feel comfortable, test only one native target. Or if most of your code is common, you could only test on the jvm and let the CI do longer tests
1
m
This is pretty specific for my project, but maybe it’ll help you. I’m running my tests as follows: • shared unit tests only on JVM, this is about 6min with clean build on GH Actions Ubuntu runner • Native tests (Android & iOS project) just as usual • Instrumented tests for iOS & Android on
macos
runner Make sure you are building the correct targets, as well as correct flavours (i.e. not building both release+debug unless you really need to). In my experience, at least with GH Actions, using the
ubuntu
runner whenever possible is far faster than the
macos
runner.
i
I appreciate all the answers. I’ve tried to architect much of my application so that much of the heavy lifting is in Use Case Interactors is just plain kotlin and other items like the repository can be stubbed. I would love it if I could have tests that built a subset (just this layer) and tested it in isolation.