我创建了由 junit 和 spock 测试组成的 maven 项目。两个测试的代码。
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 test 时,它检测了两个测试类。我在 git 存储库上部署了项目,并为 maven 项目配置了 jenkins。我推送存储库并为此项目执行作业,但是 jenkins 仅检测到 JUnit 测试的 AppTest 类。我已更改 pom.xml 并将文件 regadring 添加到https://github.com/menonvarun/testInProgress-spock-client. 我的项目结构。

文件 org.spockframework.runtime.extension.IGlobalExtension 的内容
org.imaginea.jenkins.testinprogress.spock.SpockTestInProgressExtension
pom.xml
<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 项目执行作业。还有一次詹金斯没有检测到 SpockTest 类。可能是什么问题呢?
沧海一幻觉
森栏
随时随地看视频慕课网APP
相关分类