deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core] Tests: Added nicer output for tests and CI reporter
Date Wed, 29 Aug 2012 10:17:12 GMT
From: Michal Fojtik <mfojtik@redhat.com>

* The 'turn' gem will format the test output more nicely
  and the output is more readable.

* The 'minitest_reporters' gem will add JUnit XML output
  that is parseable by Jenkins  JUnit output is enabled
  when BUILD_NUMBER environment variable is set.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/Gemfile              |    2 ++
 server/tests/test_helper.rb |   16 ++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/server/Gemfile b/server/Gemfile
index 395e39d..6fcb914 100644
--- a/server/Gemfile
+++ b/server/Gemfile
@@ -10,6 +10,8 @@ group :development do
   gem "rack-test"
   gem "minitest"
   gem "simplecov"
+  gem 'turn'
+  gem 'minitest-reporters'
   gem "webmock"
   gem "vcr"
   gem "aws"
diff --git a/server/tests/test_helper.rb b/server/tests/test_helper.rb
index 57b7fb3..bed923d 100644
--- a/server/tests/test_helper.rb
+++ b/server/tests/test_helper.rb
@@ -20,6 +20,22 @@ if ENV['COVERAGE']
   end
 end
 
+# Make the test output more nice and readable
+#
+begin
+  require 'turn'
+  Turn.config do |c|
+    c.format  = :pretty
+    c.trace   = true
+    c.natural = true
+  end
+rescue; end
+
+begin
+  require "minitest/reporters"
+  MiniTest::Reporters.use!(MiniTest::Reporters::JUnitReporter.new) if !ENV['BUILD_NUMBER'].nil?
+rescue;end
+
 def record_retries(name='', opts = {})
   opts[:before] = Proc.new { |r, &block|
     VCR.use_cassette("#{__name__}-#{name.empty? ? '' : "#{name}-"}#{r}", &block)
-- 
1.7.10.2


Mime
View raw message