如何使用Gradle和JUnit并行运行测试(每个测试) [英] How to run test in parallel (per test) using Gradle and JUnit

查看:148
本文介绍了如何使用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并行运行测试(每个测试)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆