https://kotlinlang.org logo
#kotest
Title
# kotest
b

Big Chungus

11/04/2021, 10:32 AM
Could you guys publish v5.0.0 with artefacts for all targets, please. Currently snapshots are missing artefacts for non-testable targets, however it's sstill important to have them as otherwise you can't use kotest in commonMain for projects that also have production sources for untestable targets. Here's an easy escape hatch to cover them all with a single sourceSet https://github.com/mpetuska/klip/blob/master/buildSrc/src/main/kotlin/plugin.library-mpp.gradle.kts#L52
j

Javier

11/04/2021, 10:38 AM
As I read, 5.0.0 will be released with Kotlin 1.6.0
b

Big Chungus

11/04/2021, 11:12 AM
I know, but that's irrelevant for this.
s

sam

11/04/2021, 11:30 AM
Can you make a pr ?
b

Big Chungus

11/04/2021, 11:34 AM
I'll try next week.
Just to confirm, are you happy with the general strategy of throwing errors on all actual implementations for untestable targets?
s

sam

11/04/2021, 11:36 AM
To be honest I don't know what you're asking for that's why a PR is best. Then I can review and understand.
b

Big Chungus

11/04/2021, 11:41 AM
Gotcha. I'll raise a pr regardless, but on a high level the strategy is as follows: 1. Create custom sourceSets fallbackMain and fallbackTest 2. Make them depend on commonMain and commonTest respectively 3. Implement all actuals from common sourceSets to throw errors 4. Identify targets that you cannot run tests for (e.g. mingwX86) 5. Register those targets and make their main and test sourceSets depend on fallback sourceSets That way the artifacts still get published for those targets without having to implement actuals for each of them individually
s

sam

11/04/2021, 11:43 AM
Why can't we publish for them properly
Is there a limitation
b

Big Chungus

11/04/2021, 11:52 AM
You could, but that'd just be throwaway work since code for those platforms would never get executed (untestable targets and all)
Main problem this is trying to solve is unlocking kotest usage in commonTest for projects that use those untestable targets
j

Javier

11/04/2021, 1:24 PM
Main problem of those untestable targets is the fact kotest depends on coroutines and coroutines doesn't have them, no?
b

Big Chungus

11/04/2021, 1:49 PM
Some of them do, but I see your point. However kotest public api doesn't depend on kotlinx.coroutines (or at least I haven't encountered anything that does yet), so we could introduce commonCoroutinesMain that testable targets could depend on, while commonMain wouldn't and would only use stdlib bit of coroutines support.
s

sam

11/07/2021, 8:24 AM
What does untestable target mean
b

Big Chungus

11/07/2021, 8:25 AM
Targets which you cannot run tests for (even if you write them)
Examples include mingwX86 and all linux targets except linuxX64
Oh and android native targets
s

sam

11/07/2021, 8:26 AM
I guess android makes sense. Why can't you test mingw?
2 Views