buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toulm...@apache.org
Subject svn commit: r953131 - in /buildr/trunk: CHANGELOG rakelib/rspec.rake
Date Wed, 09 Jun 2010 19:49:33 GMT
Author: toulmean
Date: Wed Jun  9 19:49:33 2010
New Revision: 953131

URL: http://svn.apache.org/viewvc?rev=953131&view=rev
Log:
BUILDR-453 Provide a ci task that uses the ci_reporter gem

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/rakelib/rspec.rake

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=953131&r1=953130&r2=953131&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Wed Jun  9 19:49:33 2010
@@ -33,6 +33,7 @@
 * Added:  BUILDR-408 Filter include() and exclude() should accept Rake tasks
 * Added:  BUILDR-409 archive.include() should convert arguments to artifact
           if applicable
+* Added:  BUILDR-453 Provide a ci task that uses the ci_reporter gem
 * Added:  ScalaTest now generates JUnit XML reports in addition to text files.
 * Change: Updated to Ant 1.8.0
 * Change: Updated to Cobertura 1.9.4.1

Modified: buildr/trunk/rakelib/rspec.rake
URL: http://svn.apache.org/viewvc/buildr/trunk/rakelib/rspec.rake?rev=953131&r1=953130&r2=953131&view=diff
==============================================================================
--- buildr/trunk/rakelib/rspec.rake (original)
+++ buildr/trunk/rakelib/rspec.rake Wed Jun  9 19:49:33 2010
@@ -18,13 +18,18 @@ begin
   require 'spec/rake/spectask'
   directory '_reports'
 
+  def default_spec_opts
+    default = %w{--format failing_examples:failed --format html:_reports/specs.html --backtrace}
+    default << '--colour' if $stdout.isatty
+  end
+  
   desc "Run all specs"
   Spec::Rake::SpecTask.new :spec=>['_reports', :compile] do |task|
     ENV['USE_FSC'] = 'no'
     task.spec_files = FileList['spec/**/*_spec.rb']
     task.spec_files.exclude('spec/groovy/*') if RUBY_PLATFORM[/java/]
-    task.spec_opts = %w{--format specdoc --format failing_examples:failed --format html:_reports/specs.html
--backtrace}
-    task.spec_opts << '--colour' if $stdout.isatty
+    task.spec_opts = default_spec_opts
+    task.spec_opts << '--format specdoc'
   end
   file('_reports/specs.html') { task(:spec).invoke }
 
@@ -32,23 +37,33 @@ begin
   Spec::Rake::SpecTask.new :failed do |task|
     ENV['USE_FSC'] = 'no'
     task.spec_files = FileList['spec/**/*_spec.rb']
-    task.spec_opts = %w{--format specdoc --format failing_examples:failed --example failed
--backtrace}
-    task.spec_opts << '--colour' if $stdout.isatty
+    task.spec_opts = default_spec_opts
+    task.spec_opts << '--format specdoc' << '--example failed'
   end
 
   desc 'Run RSpec and generate Spec and coverage reports (slow)'
   Spec::Rake::SpecTask.new :coverage=>['_reports', :compile] do |task|
     ENV['USE_FSC'] = 'no'
     task.spec_files = FileList['spec/**/*_spec.rb']
-    task.spec_opts = %W{--format progress --format failing_examples:failed --format html:_reports/specs.html
--backtrace}
-    task.spec_opts << '--colour' if $stdout.isatty
+    task.spec_opts = default_spec_opts
+    task.spec_opts << '--format progress'
     task.rcov = true
     task.rcov_dir = '_reports/coverage'
     task.rcov_opts = %w{--exclude / --include-file ^lib --text-summary}
   end
   file('_reports/coverage') { task(:coverage).invoke }
 
-
+  task :load_ci_reporter do
+    gem 'ci_reporter'
+    ENV['CI_REPORTS'] = '_reports/ci'
+    # CI_Reporter does not quote the path to rspec_loader which causes problems when ruby
is installed in C:/Program Files
+    ci_rep_path = Gem.loaded_specs['ci_reporter'].full_gem_path
+    ENV["SPEC_OPTS"] = [ENV["SPEC_OPTS"], default_spec_opts, "--require", "\"#{ci_rep_path}/lib/ci/reporter/rake/rspec_loader.rb\"",
"--format", "CI::Reporter::RSpec"].join(" ")
+  end
+  
+  desc 'Run all specs with CI reporter'
+  task :ci=>[:load_ci_reporter, :spec] 
+  
   # Useful for testing with JRuby when using Ruby and vice versa.
   namespace :spec do
     desc "Run all specs specifically with Ruby"



Mime
View raw message