tobiasstadler / pitest-junit5-plugin

JUnit 5 test framework support for Pitest
Apache License 2.0
6 stars 2 forks source link

Cannot create Launcher without at least one TestEngine when running tests #1

Open shaun-w opened 7 years ago

shaun-w commented 7 years ago

I'm trying to use your plugin to run pitest against some junit5 tests that I have but I'm having problems getting it to run... this may be something I'm doing incorrectly but I thought I'd reach out.

I've cloned and build your plugin locally on my machine, then after including it as a plugin dependency to pitest-maven, and attempting to run the goals:

mvn -U clean install
mvn org.pitest:pitest-maven:mutationCoverage

I can see that it can see the plugin from the output:

[INFO] --- pitest-maven:1.1.11:mutationCoverage (default-cli) @ junit5-pitest-tester ---
[INFO] Found plugin : Default csv report plugin
[INFO] Found plugin : Default xml report plugin
[INFO] Found plugin : Default html report plugin
[INFO] Found plugin : Default limit mutations plugin
[INFO] Found plugin : Kotlin junk mutations filter
[INFO] Found shared classpath plugin : Default mutation engine
[INFO] Found shared classpath plugin : JUnit 5 test framework support
[INFO] Adding org.pitest:pitest-junit5-plugin to SUT classpath
[INFO] Adding org.pitest:pitest to SUT classpath

However, I am getting an error shortly after that:

11:43:34 PIT >> INFO : MINION : May 25, 2017 11:43:34 AM org.pitest.junit5.org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry loadTestEngines
INFO: Discovered TestEngines with IDs: []

11:43:34 PIT >> INFO : MINION : 11:43:34 PIT >> SEVERE : Error calculating coverage. Process will exit.
org.pitest.junit5.org.junit.platform.commons.util.PreconditionViolationException: Cannot create Launcher without at least one TestEngine; consider adding an engine implementation JAR t
11:43:34 PIT >> INFO : MINION : o the classpath
    at org.pitest.junit5.org.junit.platform.commons.util.Preconditions.condition(Preconditions.java:207)
    at org.pitest.junit5.org.junit.platform.launcher.core.DefaultLauncher.<init>(DefaultLauncher.java:52)
    at org.pitest.junit5.org.junit.pla
11:43:34 PIT >> INFO : MINION : tform.launcher.core.LauncherFactory.create(LauncherFactory.java:42)
    at org.pitest.junit5.JUnit5TestUnitFinder.<init>(JUnit5TestUnitFinder.java:38)
    at org.pitest.junit5.JUnit5Configuration.testUnitFinder(JUnit5Configuration.java:35)
    at org.pitest.testapi
11:43:34 PIT >> INFO : MINION : .execute.FindTestUnits.findTestUnits(FindTestUnits.java:56)
    at org.pitest.testapi.execute.FindTestUnits.getTestUnits(FindTestUnits.java:40)
    at org.pitest.testapi.execute.FindTestUnits.findTestUnitsForAllSuppliedClasses(FindTestUnits.java:29)
    at org.pite
11:43:34 PIT >> INFO : MINION : st.coverage.execute.CoverageMinion.discoverTests(CoverageMinion.java:148)
    at org.pitest.coverage.execute.CoverageMinion.getTestsFromParent(CoverageMinion.java:128)
    at org.pitest.coverage.execute.CoverageMinion.main(CoverageMinion.java:79)

11:43:34 PIT >> SEVERE : Coverage generator Minion exited abnormally due to UNKNOWN_ERROR

I have tried including a few of the junit-jupiter-xxx and junit-platform-xxx dependencies with the pitest-maven plugin (various combinations of these), but I can't seem to get it to work, it always gives the above problem. Perhaps I'm missing some other dependency?

smoyer64 commented 6 years ago

I'm experiencing the same problem ... I've confirmed that the shaded jar contains the JupiterTestEngine and that it's referenced appropriately in META-INF/services. Can you provide any other hints?