I'm having trouble running common tests from IDEA....
# intellij
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