Friday, 24 May 2019

Inline functions are causing errors in unit test code coverage report

I'm writing some unit tests for my Android app written in Kotlin, and I'm getting errors from the included inlined collection functions, in this case specifically sortedBy

 override fun onDaysSelected(dayOfWeekList: ArrayList<DayOfWeek>) {
        view.userRoutingRule.days = dayOfWeekList.sortedBy { it.dayOfWeek }
        renderRule()
 }

This is the error I'm getting when I run my unit tests with coverage

---- IntelliJ IDEA coverage runner ---- sampling ... include patterns: com.mypackage..* exclude patterns:[2019.02.02 14:49:40] (Coverage): Class data was not extracted: com.mypackage\myfile$onDaysSelected$$inlined$sortedBy$1: java.lang.Throwable

Process finished with exit code 0

My unit tests all pass accordingly, but when I go to look at the coverage report, it's almost completely bare as this error stopped it from completing.

Is there any solution to this at this point? It's hard to know if I missed some condition if I can't just look at the report.



from Inline functions are causing errors in unit test code coverage report

No comments:

Post a Comment