Unable to run individual KotlinTests all of a sudden
I have a big Kotlin project with about 2500 unit tests written for KotlinTest. The project is a gradle project and I am able to run all the tests from a Gradle task, but normally I run them from the editor. I was able to run individual tests from the editor by clicking the Run Icon.
Yesterday this worked fine, today it doesn't. Nothing changed. Absolutely nothing. When I hover on the icon it says "Nothing Here". When I add a main function I can execute the main function, but not the tests. The test folder is marked as Test Sources Root.
This is extremely frustrating, because for every time I change something I want to test an individual Unit test and not having to test the 2500 others....
IntelliJ is up to date. Kotlin plugin is the latest.
Please sign in to leave a comment.
Do you use Gradle or IDEA JUnit runner to run individual tests?
Try as a workaround create run configuration manually for the single test - will it work?
Check also if you have the action to run individual test fro the Editor context menu invoked inside the test (like this issue describes: https://youtrack.jetbrains.com/issue/KT-20363).
Try also File | Invalidate Caches/Restart.. | Invalidate and Restart and with 3rd plugins disabled.
If problem remains, please file an issue at https://youtrack.jetbrains.com/issues/KT with the sample project or source code file to reproduce and idea.log file after IDE restart. Thanks.
I have a similar issue, except, in my case, it's with the main function. I can run junit tests fine by right clicking and choosing Run. But for files with a main function, I am getting no Run option in the right-click menu. It seems that the IDE recognizes it as a main function because it shows the Run (arrow) button in the left gutter. But when I press the run button I get: "Nothing here":