【问题标题】:Configure cucumber in TeamCity to run unit tests only using tags (Maven)在 TeamCity 中配置 cucumber 以仅使用标签 (Maven) 运行单元测试
【发布时间】:2017-07-07 18:34:17
【问题描述】:

我在一个 Maven 项目(Spring Boot)中同时进行了单元测试和验收测试。我只想在我的构建在 TeamCity 中运行时运行单元测试。我用的是黄瓜。

当我通过命令行运行测试时,一切都按预期运行(仅运行单元测试)

 c:\apache-maven-3.3.9\bin\mvn package -Dcucumber.options="--tags @unit"

但是,在 teamcity 中,所有测试都在运行(单元和验收)。似乎 teamcity 忽略了我的 cucumber.options

此外,当我在 Intellij 中双击“测试”生命周期时,所有测试也会运行(不仅仅是单元测试)所以我猜 TeamCity 正在做的正是“测试”生命周期所做的事情。

我怎样才能解决这个问题(在 TeamCity 中)?。我尝试使用“命令行”步骤,该步骤有效,但是,我丢失了所有测试报告以及测试覆盖率报告。

我通过创建(或更改)配置解决了 Intellij 问题:

【问题讨论】:

    标签: maven intellij-idea teamcity cucumber-jvm teamcity-9.0


    【解决方案1】:

    尝试在 TeamCity 中这样写: "-Dcucumber.options= --tags @unit"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-11
      • 2019-12-13
      • 2013-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多