我已经安装了 Ruby 2.0.0 和 Ruby 1.8.7、ci_reporter 1.8.4、测试单元 2.5.4、rake 10.0.3 和 pik,以便能够在我的 2 个 ruby 版本之间切换。我正在使用 Jenkins 1.501 进行“自动化测试”。
这是我的 rakefile :
require 'rake'
require 'rake/testtask'
require 'rake/packagetask'
gem 'ci_reporter'
gem 'test-unit'
require 'test/unit'
require 'ci/reporter/rake/test_unit' #http://juretta.com/log/2008/11/11/hudson_test_drive_part_1_rails/
require 'ci/reporter/rake/rspec'
task :test do
ruby "test/test1.rb"
end
我看到有些人通过更改解决了这个问题:
require 'test/unit'
require 'ci/reporter/rake/test_unit' #http://juretta.com/log/2008/11/11/hudson_test_drive_part_1_rails/
经过 :
gem 'ci_reporter'
require 'ci/reporter/rake/test_unit_loader'
但它给了我一个错误。
我有以下文件:
require 'test/unit'
class Test1 < Test::Unit::TestCase
def test_add
s = 4 + 1
assert_equal(5, s)
end
end
我的詹金斯配置是:
build --> 执行 windows 批处理 cmd --> rake ci:setup:testunit test CI_REPORTS=results post-action-build --> 发布 junit 报告 --> results/*.xml (这里我有以下警告'results / *. xml' does not match anything: even 'results' not exist
:)
文件夹“结果”是自己创建的吗?
最后是我的控制台输出:
C:\Jenkins\jobs\Jenkins TestLink Ruby\workspace>rake ci:setup:testunit test CI_REPORTS=reports
rm -rf reports
C:/Ruby200-x64/bin/ruby.exe test/test1.rb
Loaded suite test/test1
Started
.
Finished in 0.001 seconds.
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
1000.00 tests/s, 1000.00 assertions/s
Recording of test results
No test report file was not found. Configuration error?
Build step 'Publish the report of the results of JUnit tests' changed build result to FAILURE
Finished: FAILURE
没有文件夹结果,也没有 xml 输出。关于我应该做什么的任何想法?