Commit e6118347 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Adds a rake task test:scm:update to update test repositories if needed.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4643 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 1bf33bb6
...@@ -16,6 +16,7 @@ namespace :ci do ...@@ -16,6 +16,7 @@ namespace :ci do
Rake::Task["db:create"].invoke Rake::Task["db:create"].invoke
Rake::Task["db:migrate"].invoke Rake::Task["db:migrate"].invoke
Rake::Task["db:schema:dump"].invoke Rake::Task["db:schema:dump"].invoke
Rake::Task["test:scm:update"].invoke
end end
desc "Build Redmine" desc "Build Redmine"
......
...@@ -51,6 +51,20 @@ namespace :test do ...@@ -51,6 +51,20 @@ namespace :test do
task :all => supported_scms task :all => supported_scms
end end
desc "Updates installed test repositories"
task :update do
require 'fileutils'
Dir.glob("tmp/test/*_repository").each do |dir|
next unless File.basename(dir) =~ %r{^(.+)_repository$} && File.directory?(dir)
scm = $1
next unless fixture = Dir.glob("test/fixtures/repositories/#{scm}_repository.*").first
next if File.stat(dir).ctime > File.stat(fixture).mtime
FileUtils.rm_rf dir
Rake::Task["test:scm:setup:#{scm}"].execute
end
end
Rake::TestTask.new(:units => "db:test:prepare") do |t| Rake::TestTask.new(:units => "db:test:prepare") do |t|
t.libs << "test" t.libs << "test"
t.verbose = true t.verbose = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment