annotate .svn/pristine/f3/f33c6880e8251726611101bca6cb50a4896db55f.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration

Fix failure to interpret Javascript when autocompleting members for project
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 11 Sep 2014 10:24:38 +0100
parents cbb26bc654de
children
rev   line source
Chris@909 1 ### From http://svn.geekdaily.org/public/rails/plugins/generally_useful/tasks/coverage_via_rcov.rake
Chris@909 2
Chris@909 3 namespace :test do
Chris@909 4 desc 'Measures test coverage'
Chris@909 5 task :coverage do
Chris@909 6 rm_f "coverage"
Chris@909 7 rm_f "coverage.data"
Chris@909 8 rcov = "rcov --rails --aggregate coverage.data --text-summary -Ilib --html --exclude gems/"
Chris@909 9 files = Dir.glob("test/**/*_test.rb").join(" ")
Chris@909 10 system("#{rcov} #{files}")
Chris@909 11 system("open coverage/index.html") if PLATFORM['darwin']
Chris@909 12 end
Chris@909 13
Chris@909 14 desc 'Run unit and functional scm tests'
Chris@909 15 task :scm do
Chris@909 16 errors = %w(test:scm:units test:scm:functionals).collect do |task|
Chris@909 17 begin
Chris@909 18 Rake::Task[task].invoke
Chris@909 19 nil
Chris@909 20 rescue => e
Chris@909 21 task
Chris@909 22 end
Chris@909 23 end.compact
Chris@909 24 abort "Errors running #{errors.to_sentence(:locale => :en)}!" if errors.any?
Chris@909 25 end
Chris@909 26
Chris@909 27 namespace :scm do
Chris@909 28 namespace :setup do
Chris@909 29 desc "Creates directory for test repositories"
Chris@909 30 task :create_dir do
Chris@909 31 FileUtils.mkdir_p Rails.root + '/tmp/test'
Chris@909 32 end
Chris@909 33
Chris@909 34 supported_scms = [:subversion, :cvs, :bazaar, :mercurial, :git, :darcs, :filesystem]
Chris@909 35
Chris@909 36 desc "Creates a test subversion repository"
Chris@909 37 task :subversion => :create_dir do
Chris@909 38 repo_path = "tmp/test/subversion_repository"
Chris@909 39 system "svnadmin create #{repo_path}"
Chris@909 40 system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}"
Chris@909 41 end
Chris@909 42
Chris@909 43 desc "Creates a test mercurial repository"
Chris@909 44 task :mercurial => :create_dir do
Chris@909 45 repo_path = "tmp/test/mercurial_repository"
Chris@909 46 bundle_path = "test/fixtures/repositories/mercurial_repository.hg"
Chris@909 47 system "hg init #{repo_path}"
Chris@909 48 system "hg -R #{repo_path} pull #{bundle_path}"
Chris@909 49 end
Chris@909 50
Chris@909 51 (supported_scms - [:subversion, :mercurial]).each do |scm|
Chris@909 52 desc "Creates a test #{scm} repository"
Chris@909 53 task scm => :create_dir do
Chris@909 54 # system "gunzip < test/fixtures/repositories/#{scm}_repository.tar.gz | tar -xv -C tmp/test"
Chris@909 55 system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{scm}_repository.tar.gz"
Chris@909 56 end
Chris@909 57 end
Chris@909 58
Chris@909 59 desc "Creates all test repositories"
Chris@909 60 task :all => supported_scms
Chris@909 61 end
Chris@909 62
Chris@909 63 desc "Updates installed test repositories"
Chris@909 64 task :update do
Chris@909 65 require 'fileutils'
Chris@909 66 Dir.glob("tmp/test/*_repository").each do |dir|
Chris@909 67 next unless File.basename(dir) =~ %r{^(.+)_repository$} && File.directory?(dir)
Chris@909 68 scm = $1
Chris@909 69 next unless fixture = Dir.glob("test/fixtures/repositories/#{scm}_repository.*").first
Chris@909 70 next if File.stat(dir).ctime > File.stat(fixture).mtime
Chris@909 71
Chris@909 72 FileUtils.rm_rf dir
Chris@909 73 Rake::Task["test:scm:setup:#{scm}"].execute
Chris@909 74 end
Chris@909 75 end
Chris@909 76
Chris@909 77 Rake::TestTask.new(:units => "db:test:prepare") do |t|
Chris@909 78 t.libs << "test"
Chris@909 79 t.verbose = true
Chris@909 80 t.test_files = FileList['test/unit/repository*_test.rb'] + FileList['test/unit/lib/redmine/scm/**/*_test.rb']
Chris@909 81 end
Chris@909 82 Rake::Task['test:scm:units'].comment = "Run the scm unit tests"
Chris@909 83
Chris@909 84 Rake::TestTask.new(:functionals => "db:test:prepare") do |t|
Chris@909 85 t.libs << "test"
Chris@909 86 t.verbose = true
Chris@909 87 t.test_files = FileList['test/functional/repositories*_test.rb']
Chris@909 88 end
Chris@909 89 Rake::Task['test:scm:functionals'].comment = "Run the scm functional tests"
Chris@909 90 end
Chris@909 91 end