【问题标题】:Bypass Gradle Unit Tests in Azure Devops?绕过 Azure Devops 中的 Gradle 单元测试?
【发布时间】:2020-06-19 23:51:02
【问题描述】:

我们有一个带有 Gradle 任务的 Azure 管道,它运行了近 1700 个单元测试。有一些不稳定的测试 (2-3) 导致构建失败或部分成功。有没有办法可以绕过这些不稳定的测试并让构建成功运行?提前致谢。

【问题讨论】:

    标签: gradle azure-devops azure-pipelines android-unit-testing


    【解决方案1】:

    build.gradle 中添加:

    test {
        ignoreFailures = true
    }
    

    您可以找到文档here

    更好的是,如果您确切知道什么是易碎测试,您可以按如下方式排除它们:

    test {
        // explicitly exclude tests
        exclude 'org/boo/**'
    }
    

    如果别无选择,或者你赶时间,你可以跳过所有测试:

    gradlew build -x test
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-05
      • 2020-08-13
      • 2021-05-31
      • 1970-01-01
      • 2020-05-04
      • 1970-01-01
      • 2020-01-24
      相关资源
      最近更新 更多