Skip to content

Instantly share code, notes, and snippets.

@caifara
Created November 6, 2010 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caifara/665332 to your computer and use it in GitHub Desktop.
Save caifara/665332 to your computer and use it in GitHub Desktop.
lib/tasks/hudson.rake
# most of this came from: http://reprocessed.org/blog/easy_rails_ci_with_hudson
namespace :hudson do
def report_path
"hudson/reports/features/"
end
Cucumber::Rake::Task.new({'cucumber' => [:report_setup]}) do |t|
t.cucumber_opts = %{--format junit --out #{report_path}}
t.rcov = true
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/}
t.rcov_opts << %[-o "rcov"]
end
task :report_setup do
rm_rf report_path
mkdir_p report_path
end
desc "Run all specs with rcov"
RSpec::Core::RakeTask.new(:rcov => ["hudson:setup:pre_ci"]) do |t|
t.rcov = true
t.pattern = "./spec/**/*_spec.rb"
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,features\/}
t.rcov_opts << %[-o "rcov"]
end
namespace :setup do
task :pre_ci do
ENV["CI_REPORTS"] = 'hudson/reports/spec/'
gem 'ci_reporter'
require 'ci/reporter/rake/rspec'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment