Created
November 6, 2010 10:40
-
-
Save caifara/665332 to your computer and use it in GitHub Desktop.
lib/tasks/hudson.rake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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