我创建了maven项目,它由junit和spock测试组成。
public class AppTest
{
/**
* Rigorous Test :-)
*/
@Test
public void shouldAnswerWithTrue()
{
assertTrue( true );
}
}
class SpockTest extends Specification {
def "one plus one should equal two"() {
expect:
1 + 1 == 2
}
}
在我的本地机器上,当我运行mvn测试时,它会检测两个测试类。
我在git存储库上部署了项目,并为maven项目配置了jenkins。我推送存储库并执行该项目的作业,但jenkins只检测JUnit测试的AppTest类。
https://github.com/menonvarun/testInProgress-spock-client
.
我的项目结构。
文件org.spockframework.runtime.extension.IGlobalExtension的内容
org.imaginea.jenkins.testinprogress.spock.SpockTestInProgressExtension
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>1.0-groovy-2.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.imaginea.jenkins.plugins</groupId>
<artifactId>testInProgress-spock-client</artifactId>
<version>0.1</version>
<scope>test</scope>
</dependency>
</dependencies>
我在jenkins平台上安装了testInProgress插件。之后,我将更改后的maven项目推送到存储库中,并再次为maven项目执行作业。另一次jenkins没有检测到SpockTest类。有什么问题吗?