Issues with Test configuration in IntelliJ
See original GitHub issueEach time I’m working on detekt I’m having issues executing tests from IntelliJ. Generally tests run fine when executing them directly via Gradle in the command line, but when executing them in IntelliJ the test fails before it even begins running.
Is there any configuration I’m missing in my IntelliJ setup?
The tests fail with the following error:
Exception in thread "main" org.junit.platform.commons.util.PreconditionViolationException: Could not load class with name: io.gitlab.arturbosch.detekt.rules.performance.ForEachOnRangeSpec
at org.junit.platform.engine.discovery.ClassSelector.lambda$getJavaClass$0(ClassSelector.java:71)
at java.util.Optional.orElseThrow(Optional.java:290)
at org.junit.platform.engine.discovery.ClassSelector.getJavaClass(ClassSelector.java:70)
at org.jetbrains.spek.engine.SpekTestEngine.resolveSpecs(SpekTestEngine.kt:79)
at org.jetbrains.spek.engine.SpekTestEngine.discover(SpekTestEngine.kt:50)
at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:115)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:87)
at org.junit.platform.launcher.Launcher.execute(Launcher.java:93)
at org.jetbrains.spek.tooling.runner.junit.JUnitPlatformSpekRunner.run(JUnitPlatformSpekRunner.kt:107)
at org.jetbrains.spek.tooling.MainKt.main(Main.kt:58)
I’ve seen similar errors being reported on the Spek repo which currently don’t have a resolution. @arturbosch how do you usually run and debug tests in detekt?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Run/Debug configuration: JUnit | IntelliJ IDEA Documentation
JUnit run/debug configurations define how unit tests that are based on the JUnit testing framework should be run.
Read more >Run tests | IntelliJ IDEA Documentation - JetBrains
Open the Commit tool window as described in the following topics: ... . In the menu, click Choose configuration near Run Tests and...
Read more >Problems with IntelliJ 2019.3 (Ultimate) and running jUnit build
Hi,. I have complex project and recently upgraded from 2019.2 to 2019.3 ultimate edition. I have several unit tests in this project.
Read more >Testing | IntelliJ IDEA Documentation - JetBrains
Testing in IntelliJ IDEA. Learn how to create and run tests with IntelliJ IDEA. Prepare for testing. Add testing libraries and configure test...
Read more >Prepare for testing | IntelliJ IDEA Documentation - JetBrains
Learn more about testing techniques available in IntelliJ IDEA: creating a test configuration, performing tests, monitoring tests, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cleared the caches, removed
.idea
folders, reinstalled IntelliJ. Something seems to have worked, it now works fine for me. Thanks for the input @arturbosch 👍This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics.