gpt4 book ai didi

java - 如何仅重新运行失败的测试? (我用的是junit5+maven+spring boot)

转载 作者:行者123 更新时间:2023-12-01 17:06:32 24 4
gpt4 key购买 nike

仅运行失败测试,​​但在所有构建工作之后这是我的失败测试用例

ExempleIT extends BaseIT {
@Test
public void testfailure(){
Assertions.assertTrue(false);
}

这是我的基本测试类

@ExtendWith({SpringExtension.class})
@SpringBootTest()
public abstract class BaseIT { ...
  1. 我尝试过

    maven -Dfailsafe.skipAfterFailureCount=1 -Dfailsafe.rerunFailingTestsCount=2

    和surefire,但这些不支持junit5

  2. 我重新运行了木星,但这仅支持方法基,但我想使用基类进行所有测试并完成所有构建,我还可以遵循哪种其他方法?

最佳答案

检查this answer .

The maven-surefire-plugin, as of today, does not have full support of JUnit 5. There is an open issue about adding this support in SUREFIRE-1206.

As such, you need to use a custom provider.(...)

此信息来自旧帖子。

maven-surefire 的现有限制仅与 some features 相关。在 JUNIT5 上。

关于java - 如何仅重新运行失败的测试? (我用的是junit5+maven+spring boot),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61460878/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com