黄瓜 JUnit --out 目录

Cucumber JUnit --out directory

我的应用 运行s 在 Rails 3.2.18 上,在 Shippable 上持续集成,因此我不得不修改 cucumber.yml

代替这一行

default: <%= std_opts %> features

我已经插入了这个

ci: --format junit --out <%= ENV['CI_REPORTS'] %>
dev: <%= std_opts %> features
wip: --tags @wip:3 --wip features

在我尝试 运行

之后
cucumber features/reports feature/test.feature --format junit --out features

或者这个

bundle exec cucumber --format junit --out features/reports feature/test.feature

我得到以下输出

You *must* specify --out DIR for the junit formatter
Error creating formatter: junit (RuntimeError)
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/formatter/io.rb:24:in `ensure_dir'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/formatter/junit.rb:19:in `initialize'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/cli/configuration.rb:183:in `new'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/cli/configuration.rb:183:in `block in formatters'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/cli/configuration.rb:178:in `map'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/cli/configuration.rb:178:in `formatters'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/cli/configuration.rb:76:in `build_tree_walker'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/runtime.rb:46:in `run!'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/lib/cucumber/cli/main.rb:47:in `execute!'
/home/machine/.rvm/gems/ruby-1.9.3-p551/gems/cucumber-1.3.19/bin/cucumber:13:in `<top (required)>'
/home/machine/.rvm/gems/ruby-1.9.3-p551/bin/cucumber:23:in `load'
/home/machine/.rvm/gems/ruby-1.9.3-p551/bin/cucumber:23:in `<main>'
/home/machine/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `eval'
/home/machine/.rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in `<main>'

我忘了设置环境变量

export CI_REPORTS=shippable/testresults

成功了