Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringSpec produces errors when run with spring-boot thymeleaf dependency in Intellij Idea #314

Closed
TheNewBob opened this issue Apr 26, 2018 · 7 comments

Comments

@TheNewBob
Copy link

In short, a test with StringSpec produces a gazillion errors if you have spring-boot-starter-thymeleaf in your dependencies. You don't have to actually use it, just have the dependency in the project.

Here is a minimal project setup that will reproduce the issue in IntelliJ IDEA when you run the included test. Reproduction instructions are there also, as well as in the links further below:
https://github.com/TheNewBob/kotlin-test-thymeleaf

I have asked about the issue on stackoverflow. Somebody recommended to report the issue to Jetbrains, which I did, and they concluded that the source of the problem is most likely in kotlintest. It seems a bit strange, since the problem does not happen when doing gradlew test instead of running it in Intellij.

@sksamuel
Copy link
Member

Which version of KotlinTest are you using ?

@TheNewBob
Copy link
Author

The project on Github pulls 3.0.6.

@sksamuel
Copy link
Member

Thanks I'll take a look at this now.

@sksamuel
Copy link
Member

There's no such dependency as testCompile 'io.kotlintest:kotlintest:3.0.6'.

@sksamuel
Copy link
Member

It seems ok if you change the dependency to:

testCompile 'io.kotlintest:kotlintest-runner-junit5:3.0.6'

And add in

apply plugin: 'org.junit.platform.gradle.plugin'

And in the buildscript add

classpath "org.junit.platform:junit-platform-gradle-plugin:1.1.0"

The upcoming 3.1.0 release will simplify this if you use gradle 4.6+

@TheNewBob
Copy link
Author

TheNewBob commented May 3, 2018

There's no such dependency as testCompile 'io.kotlintest:kotlintest:3.0.6'.

Really sorry about that. I was running 2.0.7 before writing the issue report, realised there was a new version and just updated the version number and tested. For some reason the test ran, probably wasn't done rebuilding yet.

Looks like just pulling 'io.kotlintest:kotlintest-runner-junit5:3.0.6' fixes the issue now that I get around to trying again.

@sksamuel
Copy link
Member

sksamuel commented May 3, 2018

The error you were getting was definitely something that happened in version 2 so yes I think this issue is fixed by just upgrading. I'll close.

@sksamuel sksamuel closed this as completed May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants