https://kotlinlang.org logo
Title
j

Joseph Roffey

03/01/2021, 3:37 PM
Hello, after I run
./gradlew test
, I see a test report that is generated into
build/reports/tests/testDebugUnitTest/index.html
However, when I look at this, it does not make the difference between the results of the Android tests and the iOS Tests clear to me. Furthermore, when I add a line
assertTrue(false)
into
iosTest > KoinTest > checkAllModules
it does not register any failures, whereas when I add the same line into the
androidTest
equivalent the test does fail. Should I be running the iOS tests differently / does anyone know whether I have misunderstood something? I was under the impression that when I run the gradle tests it should test both the iOS and the Android KoinTest methods. Sorry if I’m missing something obvious.
r

russhwolf

03/01/2021, 3:43 PM
Try
./gradlew check
instead of
./gradlew test
.
The stuff in
testDebugUnitTest
is just what ran on Android, but the
check
task should also run them on iOS
j

Joseph Roffey

03/01/2021, 3:46 PM
weirdly I now get the opposite problem.
./gradlew test
seems to run the tests for Android and
./gradlew check
seems to only run the tests for iOS
is there any way to generate a report that tests both at the same time do you know?
r

russhwolf

03/01/2021, 3:48 PM
They won't rerun if there haven't been any changes. There's
cleanAllTests
to get them to rerun but it doesn't always work for Android
j

Joseph Roffey

03/01/2021, 3:48 PM
ah thank you
i’ll try that
r

russhwolf

03/01/2021, 3:48 PM
Regardless though I think they'll always generate separate test reports per run task
if
cleanAllTests
doesn't work you might need to explicitly
cleanTestDebugUnitTest
There's some bugs in there still
j

Joseph Roffey

03/01/2021, 4:13 PM
ah you’re right
when i run
./gradlew check
I get two reports out
Because the iOS one was called
allTests
and the other one seemed to have quite a generic name as well
testDebugUnitTest
I was confused
Thank you for your help @russhwolf
r

russhwolf

03/01/2021, 4:15 PM
allTests
is everything in theory. But Android stuff is weird and doesn't always fit together
🙏 1