https://kotlinlang.org logo
#gradle
Title
# gradle
h

hfhbd

10/17/2023, 9:07 AM
Are there any plans to create/support test fixtures like java-test-fixtures for Kotlin? The current workaround is using another Gradle module.
plus1 1
j

Javier

10/17/2023, 9:28 AM
There is a closed issue in YouTrack. I still don't understand why it is closed as it is marked as a problem with AGP interop, but I don't think fixtures work on KMP without Android (or maybe I am wrong).
w

wasyl

10/17/2023, 9:55 AM
Test fixtures with Kotlin do work in regular non-kmp Kotlin modules — we've been using them for quite a while now. Test fixtures do not work with Android modules, and that's an issue with AGP, to be solved on Google side: https://issuetracker.google.com/issues/139438142 I don't know what's the status on the multiplatform side 🤔
h

hfhbd

10/17/2023, 9:57 AM
Yes, Kotlin/JVM does work well with Java test fixtures, I mean Kotlin MPP, mostly Kotlin JS, to share Kotlin common code as test fixtures.
plus1 1
j

Javier

10/17/2023, 10:00 AM
but if KMP is not working, this shouldn't be closed, cc @tapchicoma
w

wasyl

10/17/2023, 10:00 AM
But I'd say it might be a good idea to open a new issue with an explicit request and sample use case, I see people mostly commenting in other issues about lack of kmm support
h

hfhbd

10/17/2023, 10:04 AM
I also found this ticket: https://youtrack.jetbrains.com/issue/KT-35073/Support-dependencies-on-commonTest-and-other-non-published-common-source-sets-from-another-Gradle-project-in-MPP which matches the
java-test-fixtures
. So we "only" need a
kotlin-test-fixtures
plugin.
t

tapchicoma

10/18/2023, 12:53 PM
I would suggest open a new issue specifically for JS and Native test-fixtures
3 Views