无法弄清楚如何与 gradle 并行运行 Serenity Web 测试。 这是 maven + jenkins 的示例。但我需要与 gradle 相同的东西。
问问题
2632 次
2 回答
4
您可以按照以下步骤执行此操作
第 1 步:创建套件文件
第二步:在gradle中输入如下任务代码
task runAParallelSuite(type: Test) {
def forks =2
exclude ('**/Library.java')
println "The Maximum parallel is $forks"
// uncomment maxParallelForks if you prefer to use the Gradle process forker
// which also requires a complete change of how the suite class works
maxParallelForks = forks
include '**/**TestSuite.class'
// testReportDir = file("${reporting.baseDir}/AParallelSuite")
// testResultsDir = file("${buildDir}/test-results/AParallelSuite")
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
}
现在在 cmd 提示符下运行命令'gradle clean runAParallelSuite aggregate'
于 2016-05-31T12:43:19.067 回答
1
这是另一种方法
test {
maxParallelForks=2
options {
systemProperties(System.getProperties())
}
...
}
maxParallelForks允许设置与 jUnit 并行执行的最大分叉测试进程数
于 2016-09-22T08:03:43.033 回答