如何使用Jenkins,Grails和Geb / Spock运行特定的规范列表

时间:2013-06-03 17:16:56

标签: grails jenkins spock geb

我有两个问题:

  • 在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中定义的参数?

提前致谢

奥利弗

2 个答案:

答案 0 :(得分:1)

我的不好,我只需要用-Dgeb.build.baseUrl l替换-Dgeb.baseUr,这一切都按预期工作。

答案 1 :(得分:0)

-Dgeb.build.baseUrl=http://localhost:32000/MyApp

是JVM参数,用于设置要测试的geb框架url。

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

-Dgeb.env=firefox

如果Jenkins只运行grails命令,则应将其设置为

所以我猜你的命令应该是

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