##// END OF EJS Templates
Remove style tags from html body (#15716)....
Remove style tags from html body (#15716). git-svn-id: http://svn.redmine.org/redmine/trunk@14315 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r13510:d85f73a30d48
r13933:e911ce7cb41c
Show More
testing.rake
110 lines | 3.7 KiB | text/x-ruby | RubyLexer
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 namespace :test do
desc 'Measures test coverage'
task :coverage do
rm_f "coverage"
Jean-Philippe Lang
Use simplecov for code coverage, rcov does not support ruby>=1.9....
r13309 ENV["COVERAGE"] = "1"
Rake::Task["test"].invoke
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 end
desc 'Run unit and functional scm tests'
task :scm do
errors = %w(test:scm:units test:scm:functionals).collect do |task|
begin
Rake::Task[task].invoke
nil
rescue => e
task
end
end.compact
abort "Errors running #{errors.to_sentence(:locale => :en)}!" if errors.any?
end
namespace :scm do
namespace :setup do
desc "Creates directory for test repositories"
Toshi MARUYAMA
add :environment to test:scm:setup:create_dir and test:scm:update rake tasks (#16881)...
r12860 task :create_dir => :environment do
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 FileUtils.mkdir_p Rails.root + '/tmp/test'
end
supported_scms = [:subversion, :cvs, :bazaar, :mercurial, :git, :darcs, :filesystem]
desc "Creates a test subversion repository"
task :subversion => :create_dir do
repo_path = "tmp/test/subversion_repository"
Jean-Philippe Lang
Prevent test:scm:setup:* task to overwrite if the test repository already exists....
r8929 unless File.exists?(repo_path)
system "svnadmin create #{repo_path}"
system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}"
end
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 end
desc "Creates a test mercurial repository"
task :mercurial => :create_dir do
repo_path = "tmp/test/mercurial_repository"
Jean-Philippe Lang
Prevent test:scm:setup:* task to overwrite if the test repository already exists....
r8929 unless File.exists?(repo_path)
bundle_path = "test/fixtures/repositories/mercurial_repository.hg"
system "hg init #{repo_path}"
system "hg -R #{repo_path} pull #{bundle_path}"
end
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 end
Toshi MARUYAMA
split method for scm test repository extracting (#16881)...
r12861 def extract_tar_gz(prefix)
unless File.exists?("tmp/test/#{prefix}_repository")
# system "gunzip < test/fixtures/repositories/#{prefix}_repository.tar.gz | tar -xv -C tmp/test"
system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{prefix}_repository.tar.gz"
end
end
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 (supported_scms - [:subversion, :mercurial]).each do |scm|
desc "Creates a test #{scm} repository"
task scm => :create_dir do
Toshi MARUYAMA
split method for scm test repository extracting (#16881)...
r12861 extract_tar_gz(scm)
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 end
end
desc "Creates all test repositories"
task :all => supported_scms
end
desc "Updates installed test repositories"
Toshi MARUYAMA
add :environment to test:scm:setup:create_dir and test:scm:update rake tasks (#16881)...
r12860 task :update => :environment do
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 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|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/unit/repository*_test.rb'] + FileList['test/unit/lib/redmine/scm/**/*_test.rb']
end
Rake::Task['test:scm:units'].comment = "Run the scm unit tests"
Rake::TestTask.new(:functionals => "db:test:prepare") do |t|
t.libs << "test"
t.verbose = true
t.test_files = FileList['test/functional/repositories*_test.rb']
end
Rake::Task['test:scm:functionals'].comment = "Run the scm functional tests"
end
Jean-Philippe Lang
Isolates all API routing tests to a specific test case....
r13222 Rake::TestTask.new(:routing) do |t|
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 t.libs << "test"
t.verbose = true
Jean-Philippe Lang
Isolates all API routing tests to a specific test case....
r13222 t.test_files = FileList['test/integration/routing/*_test.rb'] + FileList['test/integration/api_test/*_routing_test.rb']
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 end
Toshi MARUYAMA
fix "test:routing" rake task comment changed by r13604...
r13231 Rake::Task['test:routing'].comment = "Run the routing tests"
Jean-Philippe Lang
Adds first Capybara tests (#12822)....
r11040
Rake::TestTask.new(:ui => "db:test:prepare") do |t|
t.libs << "test"
t.verbose = true
Jean-Philippe Lang
Upgrade to Rails 4.2.0 (#14534)....
r13510 t.test_files = FileList['test/ui/**/*_test_ui.rb']
Jean-Philippe Lang
Adds first Capybara tests (#12822)....
r11040 end
Rake::Task['test:ui'].comment = "Run the UI tests with Capybara (PhantomJS listening on port 4444 is required)"
Toshi MARUYAMA
set "svn:eol-style" native to lib/tasks/testing.rake...
r8211 end