STAMP-project / dspot

Automatically detect and generate missing assertions for Junit test cases (also known as test amplification)
https://dspot-demo.stamp-project.eu/
GNU Lesser General Public License v3.0
114 stars 28 forks source link

maven-plugin amplify-unit-tests fails #744

Closed monperrus closed 5 years ago

monperrus commented 5 years ago

trying to run mvn eu.stamp-project:dspot-maven:amplify-unit-tests on https://github.com/SpoonLabs/metamutator/

it fails with

[INFO] Amplification of UniqueTestGeneratorTest (1 test(s))
[INFO] Assertion amplification of UniqueTestGeneratorTest (1 test(s))
[WARNING] You gave an empty filter. To use PIT, it is recommend to specify a filter, at least, the top package of your program, otherwise, PIT may take a long time or could not be run.
[WARNING] Trying to compute the top package of the project...
[INFO] Using /home/martin/workspace/spoon-metamutator/.dspot_pom.xml to run maven.
[INFO] Using /usr/share/maven/ for maven home
[INFO] run maven: /usr/share/maven//bin/mvn org.pitest:pitest-maven:mutationCoverage 
[WARN] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:03 min
[INFO] Finished at: 2019-04-08T10:05:20+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal eu.stamp-project:dspot-maven:2.0.0:amplify-unit-tests (default-cli) on project metamutator: Execution default-cli of goal eu.stamp-project:dspot-maven:2.0.0:amplify-unit-tests failed: java.lang.RuntimeException: java.lang.RuntimeException: Maven build failed! Enable verbose mode for more information (--verbose) -> [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
danglotb commented 5 years ago

Hi thank for reporting this.

dspot-maven-plugin has also another issue with TAF.

see below:

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.github.claremontqualitymanagement.TestAutomationFramework:Core:jar:2.8.7
[WARNING] 'version' contains an expression but should be a constant. @ com.github.claremontqualitymanagement.TestAutomationFramework:Core:${capability.core.version}, /tmp/TestAutomationFramework/Core/pom.xml, line 13, column 14
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] --< com.github.claremontqualitymanagement.TestAutomationFramework:Core >--
[INFO] Building TAF - Core 2.8.7
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- dspot-maven:2.0.0:amplify-unit-tests (default-cli) @ Core ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.832 s
[INFO] Finished at: 2019-04-08T11:33:20+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal eu.stamp-project:dspot-maven:2.0.0:amplify-unit-tests (default-cli) on project Core: Unable to parse configuration of mojo eu.stamp-project:dspot-maven:2.0.0:amplify-unit-tests for parameter project: Cannot find default setter in class org.apache.maven.project.MavenProject -> [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/PluginConfigurationException

Investigating both.

danglotb commented 5 years ago

DSpot was failing on metamutator because of the class in the default package.

When no filter is specified, DSpot computes a filter on the fly and this filter was not correct.

748 should fix it.

I'm gonna open a new issue for TAF, because it is not the same issue.