Closed twentylemon closed 8 months ago
@twentylemon Thanks for reporting this issue. Have you tried older versions of jqwik and/or Kotlin? Have you tried without Lombok being present?
I have tried with jqwik 1.8.1, I upgraded as part of debugging. The project contains a lot of Lombok, so removing that isn't a realistic option -- maybe in a few months once most code becomes kotlin.
About Lombok, there isn't any used in the test class. Makes me feel like it shouldn't be an issue. But Lombok has definitely surprised me many times before.
I can try downgrading kotlin, but I am pinned to 1.9. It's a work project, so I'll report back after the weekend 🙂
Do you have an isolated repo to replicate the problem?
I cannot replicate your problem. I duplicated your setup except lombok being enabled since that seems to require a config file that I haven't.
Maybe the java version plays a role. My properties look like that:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
<jqwik.version>1.8.3</jqwik.version>
<kotlin.version>1.9.22</kotlin.version>
</properties>
But something seems to be wrong with the kotlin-maven-plugin. At least on my machine, IntelliJ no longer marks the Kotlin test classes and methods with the "Run Test" triangles; that's never a problem in my Kotlin Gradle set ups.
But something seems to be wrong with the kotlin-maven-plugin. At least on my machine, IntelliJ no longer marks the Kotlin test classes and methods with the "Run Test" triangles; that's never a problem in my Kotlin Gradle set ups.
I haven't noticed anything like that. I've used the hotkey for run tests many times without fail. The kotlin-lombok plugin is experimental, but the overall kotlin-maven one -- at least I haven't noticed anything unusual.
I duplicated your setup except lombok being enabled since that seems to require a config file that I haven't.
IIRC that file is effectively empty. I can confirm after the weekend though.
Do you have an isolated repo to replicate the problem?
I don't. I'll try to whip one up; again, after the weekend though.
Thanks for quick responses!
@jlink I was able to get a minimal repo together: https://github.com/twentylemon/jqwik-kotlin-npe -- lombok seems to be a red herring, I was able to remove that altogether and still see the error.
I tried downgraded kotlin to 1.8.0, but then my tests down run at all :thinking:
@twentylemon I can replicate! Thanks.
@twentylemon Looks like a bug in Kotlin library. I'll probably have to find a workaround.
@twentylemon Please Try release "1.8.4-SNAPSHOT"
Seems my workplace doesn't have snapshot releases. They lock down maven central for """security reasons.""" I'll be able to try later tonight on my personal machine.
Using 1.8.4 in my example repo worked! Unfortunately I wasn't able to test it out on my work machine in a larger repo, though I think I realize now the issue was the wrong snapshots url. I didn't realize you used s01.oss.yadayadayada
. I'll try again at work tomorrow, but it does seem like it should be solved 😄
s01.oss
It's a faster instance than the default one. I switched over a year ago but probably forgot to update some references in the jqwik-samples repository.
Even with the correct snapshots repo, seems I am still blocked on my work pc. Oddly though, I can just download the damn jar, so that makes sense.
After adding that as a system dependency, tests are indeed running normally on the big repo as well 🎉
@twentylemon I'll mark this as closed. Feel free to reopen if some problem with the current solution shows up later.
@jlink Would this fix be part of the 1.8.4 release? Any clue when that would be available? I'd like to use the library for the big project, but I can't rely on a static jar or a snapshot release for that.
I could release it at the weekend if that helps you.
I don't mean to rush you. Whatever your release schedule normally is, that's good by me. Would just like to know so I can start using it 😄
1.8.4 has just been released.
Testing Problem
I have a java code base that we recently starting adding some kotlin to. When adding
jqwik-kotlin
as a dependency, and seemingly doing the rest of the setup, our existing tests in java fail before even starting to run anything.I've a minimal test written in java,
Snips of pom,
Removing
jqwik-kotlin
and re-running the build, the tests start to pass again.Stack trace I am getting,
That's from intellij, but the trace is essentially the same as running from
mvn test
, just the root changes tosurefire
.Suggested Solution
Discussion