【发布时间】:2015-12-19 02:23:13
【问题描述】:
我正在开发一个使用 Maven 构建并使用maven-surefire-plugin 运行以 scalatest 编写的测试的 scala 项目。
测试是这样的:
import org.scalatest.ParallelTestExecution
@RunWith(classOf[org.scalatest.junit.JUnitRunner])
class MyTest extends FunSuite with ParallelTestExecution {
// some tests
}
从一些问题中,我知道如果我们给 scalatest 一个 -P 参数,它将并行运行测试。
但是我不知道怎么配置maven-surefire-plugin,我尝试添加-P,但是导致JVM无法启动:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-P</argLine>
</configuration>
</plugin>
有什么办法吗?如果我们不能用 maven surefire 插件做到这一点,是否可以只在测试中配置它?
【问题讨论】:
标签: maven scalatest maven-surefire-plugin parallel-testing