【问题标题】:run a single integration test from a test class从测试类运行单个集成测试
【发布时间】:2015-09-05 22:20:14
【问题描述】:

我已尝试运行文档中给出的命令:

-Dgrails.env=development test-app -integration MyClass.\"从搜索页面创建新的测试东西\"

但是,这会导致为该类运行所有集成测试,而不是只运行指定的测试。我也尝试将测试重命名为无空格,但结果相同。

在 Eclipse 或命令行 (Windows) 中的行为相同。

有没有其他人遇到过这个问题,如果有,您是否找到了解决方法?

【问题讨论】:

    标签: eclipse grails testing integration-testing spock


    【解决方案1】:

    此设施尚不可用。对于解决方法,您可以使用IgnoreRest annotation表示应忽略除带有此注释的所有功能方法),例如

    @IgnoreRest
    def "should test something"() {
        ...
    } 
    

    参考。 Run single Spock test in Grails

    【讨论】:

      【解决方案2】:

      尝试不带“\”的相同操作。例如:

      grails test-app -integration MyClass."create new test thingy from search page"
      

      此外,您无需指定开发环境。这是默认设置。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-04-29
        • 1970-01-01
        • 1970-01-01
        • 2013-08-06
        • 2011-07-11
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多