【问题标题】:JUnit 5 parallel tests not running in junit-platform.properties fileJUnit 5 并行测试未在 junit-platform.properties 文件中运行
【发布时间】:2022-10-18 22:38:36
【问题描述】:

测试没有并行运行,“未使用的属性”写在属性文件中,可能是什么问题?聚甲醛:

https://gist.github.com/vindus940/60b1a6440d3be9f25ff2b00f0e74dcea

文件结构:

【问题讨论】:

    标签: java maven junit autotest


    【解决方案1】:

    我遇到了与您完全相同的问题,包括 Intellij 将 junit-platform.properties 中的属性报告为未使用。

    将 JUnit 属性添加到我的 build.gradle 最终成为我的解决方案。

    test {
        useJUnitPlatform {
            includeEngines 'junit-jupiter', 'junit-vintage'
            systemProperty 'junit.jupiter.execution.parallel.enabled', 'true'
            systemProperty 'junit.jupiter.execution.parallel.config.strategy', 'dynamic'
            systemProperty 'junit.jupiter.execution.parallel.mode.default', 'concurrent'
            systemProperty 'junit.jupiter.execution.parallel.mode.classes.default', 'concurrent'
        }
    }
    

    我正在使用以下

    • Intellij 2022.1(社区版)
    • Gradle 7.4.2
    • Java 17
    • JUnit 5.9.0

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-31
      • 1970-01-01
      • 2020-03-25
      • 1970-01-01
      • 2011-11-12
      • 2018-12-26
      • 1970-01-01
      • 2012-06-02
      相关资源
      最近更新 更多