【问题标题】:Exclude testng tests while building in jenkins在 jenkins 中构建时排除 testng 测试
【发布时间】:2015-07-23 04:57:19
【问题描述】:

我有一个包含 junit 测试和 testng 测试的测试。当我从父 pom 运行“mvn test”时它工作正常,但是在 jenkins 中构建时 testng 测试失败。我需要一种方法来跳过在 jenkins 中运行的 testng 测试。

【问题讨论】:

标签: maven jenkins junit testng


【解决方案1】:

你说你使用 jenkins,所以我假设你使用的是 maven 插件:

您是否尝试在 Maven 运行中跳过测试用例?在 maven 插件的 maven 属性部分使用以下代码:

 maven.test.failure.ignore=true

或者

请在 maven 插件的属性部分使用下面的代码来跳过测试用例

skipTests=true

希望对你有帮助

【讨论】:

    【解决方案2】:

    最好在 Jenkins 的作业配置中通过 runtime 设置:

    调用顶级 Maven -> 高级。 添加 maven.test.skip=true

    一旦测试正常,只需删除此行。

    您也可以在运行时禁用测试执行: mvn -Dmaven.test.skip=true

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-16
      • 2013-01-20
      • 2012-08-20
      • 1970-01-01
      • 2014-02-04
      • 1970-01-01
      • 2020-05-09
      • 2018-07-01
      相关资源
      最近更新 更多