【问题标题】:How to run specific list of specs using Jenkins, Grails and Geb/Spock如何使用 Jenkins、Grails 和 Geb/Spock 运行特定的规范列表
【发布时间】:2013-05-29 22:17:07
【问题描述】:

我有两个问题:

  • 在 Jenkins 中执行特定测试列表的正确命令是什么?

我们已经启动并运行了一个 Jenkins 实例,并设置了一个 grails 作业来运行我们的功能测试。 Jenkins 在未指定规范或指定 1 个规范时运行良好。但是,当通过 2 个规范时,只有第一个规范运行。 在命令行中,我这样运行我的测试: grails test-app functional: TestASpec TestBSpec2 并且它可以工作。 在詹金斯,我试过:

"test-app -functional -Dgeb.build.baseUrl=http://localhost:32000/MyApp TestASpec Test2Spec" 但它不起作用。

TestASpec 会运行,但不会运行 Test2Spec。

"test-app -functional -Dgeb.build.baseUrl=http://localhost:32000/MyApp TestASpec" 可以正常运行。

  • 我不明白baseUrl 的含义,而且传递给命令行的参数会覆盖GebConfig 中定义的参数吗?

提前致谢

奥利维尔

【问题讨论】:

    标签: grails jenkins spock geb


    【解决方案1】:

    我的错,我只需要用-Dgeb.baseUrl 替换-Dgeb.build.baseUrl,一切都按预期工作。

    【讨论】:

      【解决方案2】:
      -Dgeb.build.baseUrl=http://localhost:32000/MyApp
      

      是设置 geb 框架 url 以进行测试的 JVM 参数。

      同样的方法你可以设置环境属性来告诉geb使用什么驱动

      -Dgeb.env=firefox
      

      如果 Jenkins 只运行 grails 命令,它应该设置为

      所以我猜你的命令应该是

       test-app -functional: TestASpec TestBSpec2 --baseUrl=http://localhost:32000/MyApp
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-07-16
        相关资源
        最近更新 更多