I'm having trouble running common tests from IDEA. They run fine from the command line but whenever ...
a
I'm having trouble running common tests from IDEA. They run fine from the command line but whenever I try to run them from IDEA I get this:
Copy code
Execution failed for task ':myProject:jvmTest'.
> No tests found for given includes: [MyClass](filter.includeTestsMatching)
This is the button I'm pressing What am I doing wrong?
r
a
this is not Junit 5 but simple kotlin test common tests
Copy code
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
s
Hey @addamsson, Is it possible youโ€™re missing the following in your
build.gradle
?
Copy code
test {
    useJUnitPlatform()
}
I ran into the same issue a while ago.
๐Ÿ‘ 1
a
I'm gonna take a look
you are right!!!!!!
thanks!
although
this is a multiplatform project
where do I put this?
s
Hmm that I am not 100% sure of. Iโ€™d think the equivalent
subProjects { ... }
in your top
build.gradle
https://github.com/arrow-kt/arrow/blob/master/build.gradle#L97
a
thanks
didn't help as this is not a multiplatform project ๐Ÿ˜ž
this only happens with MPPs
s
I was afraid of that ๐Ÿ˜ž
Damn, KotlinTest 3.0 works MPP right? I know @sam planned a big refactor for 4.0, and they working on it.
a
if i run it from the CLI it is fine
this is only a problem within IDEA
s
Oh maybe you can fix that with this
a
I tried running the tests using idea instead of gradle, but that didn't change anything
s
I once ran into some weird issues, and finally discovered this was not on
Gradle (Default)
but on
IntelliJ IDEA
and that was causing me issues. Since then Iโ€™ve only worked with
Gradle (Default)
and never ran into such weird things again. I never manually changed away from default tho so not sure how that happened.
a
image.png
s
What if you run tests using
Gradle
instead?
a
it was the original setting
I just tried IDEA
s
Oh so probably not that then ๐Ÿ˜ž
a
thanks anyway ๐Ÿ™‚
๐Ÿ‘ 1
oh
I tried running Gradle from within IDEA and now it works
๐Ÿคฏ 1