question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues with Test configuration in IntelliJ

See original GitHub issue

Each 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:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mauincommented, Jul 9, 2017

Cleared the caches, removed .idea folders, reinstalled IntelliJ. Something seems to have worked, it now works fine for me. Thanks for the input @arturbosch 👍

0reactions
lock[bot]commented, Jun 20, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found