pitmp-maven-plugin icon indicating copy to clipboard operation
pitmp-maven-plugin copied to clipboard

crash with "tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite"

Open monperrus opened this issue 5 years ago • 7 comments

I'm trying to use pitmp on Spoon as follows:

mvn eu.stamp-project:pitmp-maven-plugin:descartes

This crashed with

[ERROR] Failed to execute goal eu.stamp-project:pitmp-maven-plugin:1.3.7:descartes (default-cli) on project spoon-core: Execution default-cli of goal eu.stamp-project:pitmp-maven-plugin:1.3.7:descartes failed: 1301 tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite.

Which is triggered by a lower-level error:

12:50:08 PM PIT >> INFO : MINION : 12:50:08 PM PIT >> SEVERE : Description [testClass=spoon.CompilationUnitPrintTest, name=test(spoon.CompilationUnitPrintTest)]
java.lang.NoClassDefFoundError: Could not initialize class spoon.reflect.factory.ModuleFactory$CtUnnamedModule
        at spoon.reflect.CtModelImpl.<init>(CtModelImpl.java:84)
        at spoon.reflect.factory.FactoryImpl.<init>(FactoryImpl.java:442)
        at spoon.Launcher.createFactory(Launcher.java:651)
        at spoon.Launcher.<init>(Launcher.java:148)
        at spoon.CompilationUnitPrintTest.test(CompilationUnitPrintTest.java:30)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRun
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
        at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
        at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
        at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
        at org.pitest.junit.adapter.CustomRunnerExecutor.run(CustomRunnerExecutor.java:42)
        at org.pitest.junit.adapter.AdaptedJUnitTestUnit.execute(AdaptedJUnitTestUnit.java:69)
        at org.pitest.coverage.execute.CoverageDecorator.execute(CoverageDecorator.java:50)
        at org.pitest.testapi.execute.containers.UnContainer.execute(UnContainer.java:31)
        at org.pitest.testapi.execute.Pitest.executeTests(Pitest.java:57)
        at org.pitest.testapi.execute.Pitest.run(Pitest.java:48)
        at org.pitest.coverage.execute.CoverageWorker.run(CoverageWorker.java:51)
        at org.pitest.coverage.execute.CoverageMinion.main(CoverageMinion.java:90)

Any idea?

monperrus avatar Oct 27 '20 12:10 monperrus

Is it a multimodule project? If that is the case, then be sure that you do mvn install before running PitMP and that you run PItMP in the root, not one of the modules.

oscarlvp avatar Oct 28 '20 08:10 oscarlvp

Is it a multimodule project?

No

Doing "mvn install" first does not fix the error.

monperrus avatar Oct 28 '20 08:10 monperrus

Doing "mvn install" first does not fix the error.

This was only in the case of multimodule projects.

Can you share the link to the repository?

oscarlvp avatar Oct 28 '20 09:10 oscarlvp

git clone https://github.com/INRIA/spoon/ :smile:

monperrus avatar Oct 28 '20 09:10 monperrus

@oscarlvp WDYT of this error? Thanks!

monperrus avatar Nov 11 '20 06:11 monperrus

Hi @oscarlvp Tried again, I confirm that the error on Spoon is still there with the new release.

monperrus avatar Dec 23 '20 16:12 monperrus

Hi @oscarlvp Tried again, I confirm that the error on Spoon is still there with the new release.

PitMP is not using the latest version, so no change was expected on this. Have you tried Descartes alone?

oscarlvp avatar Dec 27 '20 12:12 oscarlvp