I'm trying to test my maven app using Spock. But mvn test
does not run my test.
[INFO] No tests to run.
I tried to name test file like *Test
, Test*
and *TestCase
but it does not work. Intellij run tests correctly and count code covers.
Also when I run mvn sonar:sonar
SonarQuebe does not see tests.
Pom.xml
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>0.6-groovy-1.8</version>
<scope>test</scope>
</dependency>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
</plugin>
It's modular maven project. I'm trying to test one of few module.
Here you can find an exemplar POM with spock settings:
Your tests are Groovy files. You need to configure surefire , so that it works with the Groovy language.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.