本文介绍了如何使用Gradle和JUnit并行运行测试(每个测试)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以并行地(按方法)在单个Test类中运行测试吗?

Can you run tests in a single Test class in parallel (per method)?

我正在设置并行执行

test {
  maxParallelForks = 2
}

样本测试

public class MyTest {
    @org.junit.Test
    public void testOne() {}

    @org.junit.Test
    public void testTwo() {}
}

但它仅适用于多个类.

推荐答案

Gradle(最佳并行化级别在测试类级别.

There is no support for this in Gradle, the finest level of parallelisation is at the test class level.

这篇关于如何使用Gradle和JUnit并行运行测试(每个测试)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 14:03
查看更多