Running JUnit Tests in Parallel in IntelliJ IDEA

后端 未结 3 2179
温柔的废话
温柔的废话 2020-12-17 15:43

I have a large suite of tests that takes about half an hour to run and would love to be able to the test classes in parallel.

Is there a way to do that with IntelliJ

相关标签:
3条回答
  • 2020-12-17 15:57

    Answering late for posterity.

    You can make JUnit tests run in parallel (or serial) to any level of granularity in IntelliJ by changing the Fork mode in the test's run configuration.

    Be careful not to confuse this with the Allow parallel run option, which lets you start the test execution multiple times within your IDE.

    0 讨论(0)
  • 2020-12-17 15:58

    If you are using JUnit4, you can give this plugin a try: https://plugins.jetbrains.com/plugin/12959-junit4-parallel-runner

    Running tests in parallel is as easy as clicking on the green triangle next to a

    • class -> all the test methods in the class are run in parallel
    • package -> all the classes in the package are run in parallel
    0 讨论(0)
  • 2020-12-17 16:19

    IDEA will understand parallel JUnit tests only since version 10.

    There is a tracker issue which you can vote for and watch for progress: http://youtrack.jetbrains.net/issue/IDEA-47103

    We plan to add it in IDEA 10, but the priority would depend on the number of votes.

    0 讨论(0)
提交回复
热议问题