gpt4 book ai didi

maven - 如何与 maven surefire 插件并行运行 scalatest?

转载 作者:行者123 更新时间:2023-12-02 11:22:10 25 4
gpt4 key购买 nike

我正在开发一个使用 Maven 构建的 Scala 项目和 maven-surefire-plugin运行在 Scalatest 中编写的测试。

测试是这样的:

import org.scalatest.ParallelTestExecution

@RunWith(classOf[org.scalatest.junit.JUnitRunner])
class MyTest extends FunSuite with ParallelTestExecution {
// some tests
}

从一些问题中,我知道如果我们给一个 -P参数 scalatest,它将并行运行测试。

但我不确定如何使用 maven-surefire-plugin 配置它,我尝试添加 -P ,但导致JVM无法启动:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-P</argLine>
</configuration>
</plugin>

有什么办法吗?如果我们不能用 maven surefire 插件来做,是否可以只在测试中配置它?

最佳答案

如果您所有的测试都是用 scalatest 编写的,那么您应该使用 scalatest maven 插件而不是surefire。有

文档:
http://www.scalatest.org/user_guide/using_the_scalatest_maven_plugin

来源:
https://github.com/scalatest/scalatest-maven-plugin

关于maven - 如何与 maven surefire 插件并行运行 scalatest?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32711252/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com