Skip to content

Instantly share code, notes, and snippets.

@katoy
Created June 24, 2012 02:49
Show Gist options
  • Save katoy/2981237 to your computer and use it in GitHub Desktop.
Save katoy/2981237 to your computer and use it in GitHub Desktop.
jenkins-tap
次のコマンド実行で、tap 出力から html レポートを生成できる。
$ prove -Q --exec="bacon --tap" --formatter=TAP::Formatter::HTML test.rb > 1.html
生成レポートの例;
http://www.spurkis.org/TAP-Formatter-HTML/test-output.html
# gem install bacon
# or
# bundle install
#
# bacon test.rb --tap
# or
# bacon test.rb --tap -Q
describe "a example test suite" do
it "should consider true as the truth" do
true.should.be.true
end
it "should consider false as the truth, too" do
false.should.be.true
end
it "should consider xxx" do
raise "xxx"
true.should.be.true
end
it "should consider true as the truth X-1 # SKIP" do
next # skip
end
it "should consider true as the truth X-2" do
next # skip
end
end
# bundle install
# $ bacon test.rb --tap -Q
output = <<EOS
ok 1 - should consider true as the truth
not ok 2 - should consider false as the truth, too: FAILED
not ok 3 - should consider xxx: ERROR: RuntimeError
not ok 4 - should consider true as the truth X-1 # SKIP: MISSING
not ok 5 - should consider true as the truth X-2: MISSING
1..5
EOS
# using from jenkins.
#
# ビルド
# * シェルの実行
# シェルスクリプト bacon %WORKSPACE/test.rb --tap > %ORKSPACE/test.tap.txt
#
# ビルド後の処理
# * Publish TAP Result
# Test Results [test*.tap.txt]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment