某些ScalaTest套件未执行

时间:2019-03-05 20:56:12

标签: scala scalatest

给出一个跟随ScalaTest签名的类:

class GEMTests extends FunSuite with Matchers with BeforeAndAfterAll {

其中包含一些启用的测试,如下所示:

test("GEMFullPostal") {
   // logic, logic, ..
}

为什么某些测试套件被执行?其他测试套件正在正确运行。

当我通过Intellij运行测试套件时,它确实运行了给定的测试-由于错误的sql语句,该测试套件立即失败。但是两者

  mvn test

和Jenkins CI / CD构建允许整个应用程序通过scalatest。我在输出中看不到该特定类的内容。

因此.. intellij将该类识别为ScalaTest,但是maven命令行(包括jenkins)已将其跳过。该测试套件可能有什么“特殊之处”?请注意,与 自动运行的其他测试套件位于同一目录中。

1 个答案:

答案 0 :(得分:0)

发现了问题:pom.xml插件内部发生了过滤机制

scalatest

因此解决方法是将 <plugin> <groupId>org.scalatest</groupId> <executions> <execution> <id>test</id> <goals> <goal>test</goal> </goals> <configuration> <suffixes>(?&lt;!Integration)(Test|Spec)</suffixes> </configuration> </execution> 扩展名添加到该过滤器:

Tests