Ruby 使用Rake在Jenkins提交黄瓜测试

Ruby 使用Rake在Jenkins提交黄瓜测试,ruby,jenkins,cucumber,rake,Ruby,Jenkins,Cucumber,Rake,我似乎对Rake和Cucumber特性文件有一些问题 这是詹金斯的命令。它指定了我直接放在./features目录中的Rake文件,因此testjson.feature就在那里 /usr/local/bin/rake --rakefile /home/robm/code/BDD/practise-tests/testtq/features/Rakefile Rakefile看起来像这样: require 'cucumber/rake/task' Cucumber::Rake::Task.n

我似乎对Rake和Cucumber特性文件有一些问题

这是詹金斯的命令。它指定了我直接放在./features目录中的Rake文件,因此testjson.feature就在那里

/usr/local/bin/rake --rakefile /home/robm/code/BDD/practise-tests/testtq/features/Rakefile 
Rakefile看起来像这样:

require 'cucumber/rake/task'

Cucumber::Rake::Task.new :features do |t|
 t.cucumber_opts = '*.feature'
end
这非常简单,但在Jenkins的控制台输出中,我得到:

 Feature: Validate DUT JSON
    JSON should be evaluated for all routes in API
    All API routes should return valid JSON
    If JSON is invalid for one or more route in API it has DUT failed

  Scenario Outline: Validate JSON                             # testJson.feature:6
    Given there is a DUT with "<input>" and "<un>" and "<pw>" # testJson.feature:7
    When the JsonTest code is run                             # testJson.feature:8
    Then the output should be "<output>"                      # testJson.feature:9

    Examples: 
      | input           | un    | pw         | output |
      | 172.168.101.139 | username | password | CHECK  |
      | 172.168.101.214 | username | password | CHECK  |

2 scenarios (2 undefined)
6 steps (6 undefined)
0m0.007s
这说明它找不到特征文件,对吗

当我转到功能文件上方的目录并运行测试时,测试工作正常


显然,我的Rake文件有一个错误。有什么想法吗?

我把它作为我的Rake工作目录放进去了 /home/robm/code/BDD/Practice tests/testtq

然后指定特征文件

./features/testJson.feature


这使它起作用了。我不知道为什么另一个不起作用。

欢迎使用堆栈溢出。因此,它支持许多问题和答案的格式选项,使我们更容易阅读您所写的内容。有关更多信息,请参阅。