我们有很多使用Spring的集成测试。我们不希望在每个测试中创建单独的JVM进程(maxParallelForks选项),或者只在多模块项目(--并行)中运行并行构建。
我们希望有一个测试类并行地执行测试,比如在Maven中使用http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html和并行选项
使用并行选项要记住的重要一点是:并发发生在同一个JVM进程中。
是否有可能在Gradle中实现?
发布于 2015-05-04 08:48:46
@MariuszS回答是最好的
Gradle是一个没有xml的ant,也许这可以帮助您实现Ant.apache.org/手册/任务/并行.Tasks :)
实现这一目标的最接近的方法在这里描述-https://discuss.gradle.org/t/how-to-use-ants-parallel-target/6720/5
task runAllTestsByGroups << {
ant.parallel(threadsPerProcessor: 1) {
ant.junit (...) {
// run test group 1
...
}
ant.junit(...) {
// run test group 2
...
}
// run group 3, 4, 5 ...
}
}
发布于 2015-02-25 08:13:21
https://stackoverflow.com/questions/28345123
复制