我正在使用Jenkins v1.467进行多个ruby管理脚本(而不是rails)的持续集成。我注意到当我在本地运行它时输出看起来很正常,但是当我看到jenkins日志时它不打印单元测试输出。
詹金斯输出
[SEACE API - Build and Unit Test] $ rake TESTOPTS=-v
/usr/local/bin/ruby -w -I"lib" -I"/usr/local/lib/ruby/1.9.1" "/usr/local/lib/ruby/1.9.1/rake/rake_test_loader.rb" "test/parser-test.rb" "test/url-mapper-test.rb" -v
=> Execute Unit Tests
本地运行
TestMapper:
test_map_all: /Users/lmayorga/GitRepositories/seaceapi/src/mapper.rb:44:in `map_attributes': warning: URI.escape is obsolete
/Users/lmayorga/GitRepositories/seaceapi/test/url-mapper-test.rb:26:in `test_map_all': warning: URI.escape is obsolete
.: (0.000954)
test_no_parameters: /Users/lmayorga/GitRepositories/seaceapi/src/mapper.rb:44:in `map_attributes': warning: URI.escape is obsolete
/Users/lmayorga/GitRepositories/seaceapi/test/url-mapper-test.rb:34:in `test_no_parameters': warning: URI.escape is obsolete
.: (0.000633)
TestParser:
test_contains_bases_link: .: (3.745998)
test_contains_name: .: (3.204862)
test_contains_region: .: (3.062733)
test_contains_valid_date: .: (3.188995)
test_get_all: .: (3.231105)
我认为我的Rake文件测试任务看起来很不错。
Rake::TestTask.new(:test) do |t|
t.warning = true
t.verbose = true
t.test_files = FileList['test/*-test.rb']
end
我在这里错过了什么吗?
答案 0 :(得分:0)
您是否检查过是否需要任何其他环境变量来运行rake任务? Jenkins构建中没有所有变量。