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.

Clarify on the use of useJUnitPlatform()

See original GitHub issue

The changelog states that even with Gradle 4.6 applying the JUnit Platform plugin is still required despite it being deprecated by the JUnit team. However, my hunch is that this is only the case if no

test {
    useJUnitPlatform()
}

is used. Could you please clarify (in the change log) whether the note even applies with useJUnitPlatform()?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:38 (35 by maintainers)

github_iconTop GitHub Comments

3reactions
sksamuelcommented, Apr 20, 2018

I believe the current master has this fixed. I’ll do another 3.1.0 release candidate as soon as I can so we have other people verify the fix.

2reactions
bondpp7commented, Apr 12, 2018

~I tried, and found that the tests are not found if you do not include the gradle-plugin, even with useJUnitPlatform().~ It would be nice if this could be corrected, as including both is likely to eventually cause issues as they update JUnit.

UPDATE: I tried removing the plugin again, and this time, the tests were found. I have since updated my JUnit5 from 5.1.0 to 5.1.1, but I doubt that had any affect. I may have simply had some stale code during my initial test?

UPDATE 2: Found the reason for the discrepency: in the second instance, Intellij was using the ‘junit runner’ rather than the gradle runner. Junit doesn’t have trouble discovering the tests, but the standard gradle runner DOES.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot find method useJUnitPlatform for test task in gradle
Here is how I fixed it. I had this test task in my build.gradle : tasks.withType(Test) { useJUnitPlatform() testLogging { exceptionFormat ...
Read more >
Gradle Sonarqube Plugin Not pushing code coverage report ...
We do use test { useJUnitPlatform() }. We generate both xml and html reports using jacoco looking at the coverage results in the...
Read more >
On the mysteries of kotlin.test - Level Up Coding
Configure Gradle to use JUnit5: tasks { test { useJUnitPlatform() } }. But why? Why do you need extra dependencies for JUnit5, ...
Read more >
Testing in Java & JVM projects - Gradle User Manual
A test task of type Test that runs those unit tests. The JVM language plugins use the source set to configure the task...
Read more >
Using Java feature previews with Gradle
Instead, we're going to explain how to configure your Gradle build to use feature previews and therefore report issues/bugs to the JDK team....
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