EvoSuite / evosuite

EvoSuite - automated generation of JUnit test suites for Java classes
http://www.evosuite.org
GNU Lesser General Public License v3.0
832 stars 341 forks source link

[Release 1.0.6] Maven config instructions not working #363

Open victorgveloso opened 3 years ago

victorgveloso commented 3 years ago

Context

I've followed the steps from the documentation. However the following excerpt seems to have a problem:

Beside configuring the plugin, there is also the need to add the EvoSuite runtime, which is used by the generated test cases. This can be done by adding the following Maven dependency in the pom.xml:

<dependency>
  <groupId>org.evosuite</groupId>
  <artifactId>evosuite-standalone-runtime</artifactId>
  <version>${evosuiteVersion}</version>
  <scope>test</scope>
</dependency>

Steps to Reproduce

Please break down here below all the needed steps to reproduce the issue. [If possible, please upload an example of the project you are generating tests for.]

  1. Fetch the example project: git clone https://github.com/victorgveloso/RingBufferedQueue .
  2. Apply the changes suggested at the documentation.
  3. Run mvn compile evosuite:generate

EvoSuite Arguments

Not relevant

Current Result

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'build.plugins.plugin[org.pitest:pitest-maven].dependencies.dependency.scope' for org.evosuite:evosuite-standalone-runtime:jar must be one of [compile, runtime, system] but is 'test'. @ line 69, column 32
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project br.ufv.aserg.victorveloso:Queue:1.0-SNAPSHOT (/home/victor/Universidade/Master/TestGeneration/ToolEvaluation/EvoSuite/RingBufferedQueue/pom.xml) has 1 error
[ERROR]     'build.plugins.plugin[org.pitest:pitest-maven].dependencies.dependency.scope' for org.evosuite:evosuite-standalone-runtime:jar must be one of [compile, runtime, system] but is 'test'. @ line 69, column 32
[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/ProjectBuildingException

Expected result

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< br.ufv.aserg.victorveloso:Queue >-------------------
[INFO] Building Queue 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> evosuite-maven-plugin:1.0.6:generate (default-cli) > compile @ Queue >>>
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.2:prepare-agent (default) @ Queue ---
[INFO] argLine set to -javaagent:/home/victor/.m2/repository/org/jacoco/org.jacoco.agent/0.8.2/org.jacoco.agent-0.8.2-runtime.jar=destfile=/home/victor/Universidade/Master/TestGeneration/ToolEvaluation/EvoSuite/RingBufferedQueue/target/jacoco.exec
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Queue ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/victor/Universidade/Master/TestGeneration/ToolEvaluation/EvoSuite/RingBufferedQueue/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ Queue ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< evosuite-maven-plugin:1.0.6:generate (default-cli) < compile @ Queue <<<
[INFO]
[INFO]
[INFO] --- evosuite-maven-plugin:1.0.6:generate (default-cli) @ Queue ---
[INFO] Going to generate tests with EvoSuite
[INFO] Total memory: 800mb
[INFO] Time per class: 2 minutes
[INFO] Number of used cores: 1
[INFO] Target: /home/victor/Universidade/Master/TestGeneration/ToolEvaluation/EvoSuite/RingBufferedQueue/target/classes
[INFO] Basedir: /home/victor/Universidade/Master/TestGeneration/ToolEvaluation/EvoSuite/RingBufferedQueue
[INFO] Started spawn process manager on port 36395
[INFO] SLF4J: Class path contains multiple SLF4J bindings.
[INFO] SLF4J: Found binding in [jar:file:/home/victor/.m2/repository/org/evosuite/evosuite-master/1.0.6/evosuite-master-1.0.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[INFO] SLF4J: Found binding in [jar:file:/home/victor/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[INFO] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[INFO] SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
[INFO] * EvoSuite 1.0.6
[INFO] Registered remote process from /127.0.0.1:46250
[INFO] Going to execute 1 jobs
[INFO] Estimated completion time: 2 minutes, by 2021-06-10T04:36:08.972
[INFO] Going to start job for: br.ufmg.aserg.victorveloso.queue.Queue. Expected to end in 120 seconds, by 2021-06-10T04:36:08.985
[INFO] Registered remote process from /127.0.0.1:46252
[INFO] Registered remote process from /127.0.0.1:46254
[INFO] Completed job. Left: 0
[INFO] * Updating database to br.ufmg.aserg.victorveloso.queue.Queue
[INFO] === CTG run results ===
[INFO] Removed test suites: 0
[INFO] New test suites: 1
[INFO] Stopping spawn process manager
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:17 min
[INFO] Finished at: 2021-06-10T04:35:25-03:00
[INFO] ------------------------------------------------------------------------

Additional info

A relevant line from the current result is: [ERROR] 'build.plugins.plugin[org.pitest:pitest-maven].dependencies.dependency.scope' for org.evosuite:evosuite-standalone-runtime:jar must be one of [compile, runtime, system] but is 'test'. @ line 69, column 32. According to it, testis not a valid value for <scope> tag and it already print alternative options [compile, runtime, system].

I've tried two solutions:

  1. Removing <scope>test</scope> (it seems to be working fine)
  2. Changing <scope>test</scope> to the recommended options. Two out of three configurations seems to be working (<scope>compile</scope> and <scope>runtime</scope>), but <scope>system</scope> results in the following error:
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'build.plugins.plugin[org.pitest:pitest-maven].dependencies.dependency.systemPath' for org.evosuite:evosuite-standalone-runtime:jar is missing. @ line 65, column 33
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project br.ufv.aserg.victorveloso:Queue:1.0-SNAPSHOT (/home/victor/Universidade/Master/TestGeneration/ToolEvaluation/EvoSuite/RingBufferedQueue/pom.xml) has 1 error
[ERROR]     'build.plugins.plugin[org.pitest:pitest-maven].dependencies.dependency.systemPath' for org.evosuite:evosuite-standalone-runtime:jar is missing. @ line 65, column 33
[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/ProjectBuildingException

For now I'll ignore the <scope> tag and I'll remove it from the pom.xml.

My question is: Shouldn't it be removed from the tutorial (inside the maven-plugin documentation)?