Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven build fails when no mutation found (should be a warning ?) #731

Closed
gibello opened this issue Mar 8, 2019 · 4 comments
Closed

Maven build fails when no mutation found (should be a warning ?) #731

gibello opened this issue Mar 8, 2019 · 4 comments
Labels
maven-plugin This issue is related to the module DSpot - Maven misuse Problem due to misusage

Comments

@gibello
Copy link

gibello commented Mar 8, 2019

Characteristics

  • Issue Type: [bug]
  • Reproducibility: [always]
  • Severity: [minor]
  • Tool/Service/Component: [dspot maven plugin]
  • Execution Environment: [Linux Ubuntu 18.04]
  • Reporter: [Pierre-Yves Gibello, [email protected]]

Description

When unable to provide mutation tests, DSpot maven plugin causes maven build failure.

[INFO] Mutating from /home/gibello/STAMP/STAMP-project/authzforce/core/pdp-testutils/target/classes
14:12:21 PIT >> INFO : Verbose logging is disabled. If you encounter an problem please enable it before reporting an issue.
14:12:22 PIT >> INFO : Sending 5 test classes to minion
14:12:22 PIT >> INFO : Sent tests to minion
14:12:22 PIT >> INFO : MINION : 14:12:22 PIT >> INFO : Checking environment

14:12:23 PIT >> INFO : MINION : 14:12:23 PIT >> INFO : Found 0 tests

14:12:23 PIT >> INFO : MINION : 14:12:23 PIT >> INFO : Dependency analysis reduced number of potential tests by 0

14:12:23 PIT >> INFO : MINION : 14:12:23 PIT >> INFO : 0 tests received

14:12:23 PIT >> INFO : Calculated coverage in 1 seconds.
14:12:23 PIT >> INFO : Created 0 mutation test units
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.150 s
[INFO] Finished at: 2019-03-08T14:12:23+01:00
[INFO] Final Memory: 20M/222M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.4.0:mutationCoverage (default-cli) on project authzforce-ce-core-pdp-testutils: Execution default-cli of goal org.pitest:pitest-maven:1.4.0:mutationCoverage failed: No mutations found. This probably means there is an issue with either the supplied classpath or filters.
[ERROR] See http://pitest.org for more details.
[ERROR] -> [Help 1]

Steps to reproduce

Tested on OW2 authzforce project.

Properties file
<plugin>
           <groupId>eu.stamp-project</groupId>
           <artifactId>dspot-maven</artifactId>
           <version>2.0.1-SNAPSHOT</version>
           <configuration>
            <src>pdp-engine/src/main/java</src>
            <testSrc>pdp-engine/src/test/java</testSrc>
            <testCriterion>PitMutantScoreSelector</testCriterion>
            <verbose>true</verbose>
            <generate-new-test-class>true</generate-new-test-class>
            <with-comment>true</with-comment>
           </configuration>
          </plugin>
Full error trace

14:12:22 PIT >> INFO : MINION : 14:12:22 PIT >> INFO : Checking environment

14:12:23 PIT >> INFO : MINION : 14:12:23 PIT >> INFO : Found 0 tests

14:12:23 PIT >> INFO : MINION : 14:12:23 PIT >> INFO : Dependency analysis reduced number of potential tests by 0

14:12:23 PIT >> INFO : MINION : 14:12:23 PIT >> INFO : 0 tests received

14:12:23 PIT >> INFO : Calculated coverage in 1 seconds.
14:12:23 PIT >> INFO : Created 0 mutation test units
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.150 s
[INFO] Finished at: 2019-03-08T14:12:23+01:00
[INFO] Final Memory: 20M/222M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.pitest:pitest-maven:1.4.0:mutationCoverage (default-cli) on project authzforce-ce-core-pdp-testutils: Execution default-cli of goal org.pitest:pitest-maven:1.4.0:mutationCoverage failed: No mutations found. This probably means there is an issue with either the supplied classpath or filters.
[ERROR] See http://pitest.org for more details.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] org.ow2.authzforce:authzforce-ce-core .............. SUCCESS [02:17 min]
[INFO] org.ow2.authzforce:authzforce-ce-core-pdp-engine ... SUCCESS [02:16 min]
[INFO] org.ow2.authzforce:authzforce-ce-core-pdp-testutils FAILURE [01:19 min]
[INFO] org.ow2.authzforce:authzforce-ce-core-pdp-io-xacml-json SKIPPED
[INFO] org.ow2.authzforce:authzforce-ce-core-pdp-cli ...... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:56 min
[INFO] Finished at: 2019-03-08T14:12:23+01:00
[INFO] Final Memory: 66M/785M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal eu.stamp-project:dspot-maven:2.0.1-SNAPSHOT:amplify-unit-tests (default-cli) on project authzforce-ce-core-pdp-testutils: Execution default-cli of goal eu.stamp-project:dspot-maven:2.0.1-SNAPSHOT:amplify-unit-tests failed: java.lang.RuntimeException: java.lang.RuntimeException: Maven build failed! Enable verbose mode for more information (--verbose) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal eu.stamp-project:dspot-maven:2.0.1-SNAPSHOT:amplify-unit-tests (default-cli) on project authzforce-ce-core-pdp-testutils: Execution default-cli of goal eu.stamp-project:dspot-maven:2.0.1-SNAPSHOT:amplify-unit-tests failed: java.lang.RuntimeException: java.lang.RuntimeException: Maven build failed! Enable verbose mode for more information (--verbose)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal eu.stamp-project:dspot-maven:2.0.1-SNAPSHOT:amplify-unit-tests failed: java.lang.RuntimeException: java.lang.RuntimeException: Maven build failed! Enable verbose mode for more information (--verbose)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Maven build failed! Enable verbose mode for more information (--verbose)
at eu.stamp_project.DSpotMojo.execute (DSpotMojo.java:304)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Maven build failed! Enable verbose mode for more information (--verbose)
at eu.stamp_project.automaticbuilder.maven.MavenAutomaticBuilder.runPit (MavenAutomaticBuilder.java:144)
at eu.stamp_project.automaticbuilder.maven.MavenAutomaticBuilder.runPit (MavenAutomaticBuilder.java:150)
at eu.stamp_project.dspot.selector.PitMutantScoreSelector.init (PitMutantScoreSelector.java:84)
at eu.stamp_project.dspot.Amplification.amplification (Amplification.java:87)
at eu.stamp_project.dspot.DSpot._amplify (DSpot.java:274)
at eu.stamp_project.dspot.DSpot._amplifyTestClass (DSpot.java:265)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining (ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:499)
at eu.stamp_project.dspot.DSpot._amplifyTestClasses (DSpot.java:261)
at eu.stamp_project.dspot.DSpot.amplifyAllTests (DSpot.java:147)
at eu.stamp_project.Main.run (Main.java:59)
at eu.stamp_project.DSpotMojo.execute (DSpotMojo.java:302)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.RuntimeException: Maven build failed! Enable verbose mode for more information (--verbose)
at eu.stamp_project.automaticbuilder.maven.MavenAutomaticBuilder.runPit (MavenAutomaticBuilder.java:141)
at eu.stamp_project.automaticbuilder.maven.MavenAutomaticBuilder.runPit (MavenAutomaticBuilder.java:150)
at eu.stamp_project.dspot.selector.PitMutantScoreSelector.init (PitMutantScoreSelector.java:84)
at eu.stamp_project.dspot.Amplification.amplification (Amplification.java:87)
at eu.stamp_project.dspot.DSpot._amplify (DSpot.java:274)
at eu.stamp_project.dspot.DSpot._amplifyTestClass (DSpot.java:265)
at java.util.stream.ReferencePipeline$3$1.accept (ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining (ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto (AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto (AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential (ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate (AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect (ReferencePipeline.java:499)
at eu.stamp_project.dspot.DSpot._amplifyTestClasses (DSpot.java:261)
at eu.stamp_project.dspot.DSpot.amplifyAllTests (DSpot.java:147)
at eu.stamp_project.Main.run (Main.java:59)
at eu.stamp_project.DSpotMojo.execute (DSpotMojo.java:302)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

@danglotb
Copy link
Member

danglotb commented Mar 8, 2019

Hello @gibello

DSpot and PIT work both at module level, you cannot run them at the top of the project.

Your configuration should be something like this:

         <plugin>
           <groupId>eu.stamp-project</groupId>
           <artifactId>dspot-maven</artifactId>
           <version>2.0.1-SNAPSHOT</version>
           <configuration>
            <targetModule>pdp-engine</targetModule>
            <src>src/main/java</src>
            <testSrc>src/test/java</testSrc>
            <testCriterion>PitMutantScoreSelector</testCriterion>
            <verbose>true</verbose>
            <generate-new-test-class>true</generate-new-test-class>
            <with-comment>true</with-comment>
           </configuration>
          </plugin>

You have to specify which module you want to target with the property <targetModule>.

In the case of PIT is in error, DSpot stops since it does not have the baseline for the amplification, i.e. the mutation score before amplification.

You can refer to the README, section Maven plugin usage for more information.

@danglotb danglotb added misuse Problem due to misusage maven-plugin This issue is related to the module DSpot - Maven labels Mar 8, 2019
@gibello
Copy link
Author

gibello commented Mar 11, 2019

Same error occurs after fixing config. Works with Jacoco (and worked before, as well), but not Pit.

@danglotb
Copy link
Member

danglotb commented Apr 9, 2019

Hello @gibello

Should we close this issue?

@gibello
Copy link
Author

gibello commented Apr 15, 2019

Hi @danglotb,
Is it fixed ? Or considered a "functionality" properly documented ? I did not try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maven-plugin This issue is related to the module DSpot - Maven misuse Problem due to misusage
Projects
None yet
Development

No branches or pull requests

2 participants