Commit a028360f5d20ec8435a600113374004b709450ac
1 parent
9480ef03
Exists in
master
and in
29 other branches
Apply migrations from all plugins before tests
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
lib/tasks/plugins_tests.rake
@@ -4,13 +4,18 @@ | @@ -4,13 +4,18 @@ | ||
4 | def define_task(test, plugins_folder='plugins', plugin = '*') | 4 | def define_task(test, plugins_folder='plugins', plugin = '*') |
5 | test_files = Dir.glob(File.join(Rails.root, plugins_folder, plugin, 'test', test[:folder], '**', '*_test.rb')) | 5 | test_files = Dir.glob(File.join(Rails.root, plugins_folder, plugin, 'test', test[:folder], '**', '*_test.rb')) |
6 | desc 'Runs ' + (plugin != '*' ? plugin : 'plugins') + ' ' + test[:name] + ' tests' | 6 | desc 'Runs ' + (plugin != '*' ? plugin : 'plugins') + ' ' + test[:name] + ' tests' |
7 | - Rake::TestTask.new(test[:name].to_sym => 'db:test:prepare') do |t| | 7 | + Rake::TestTask.new(test[:name].to_sym => 'db:test:plugins:prepare') do |t| |
8 | t.libs << 'test' | 8 | t.libs << 'test' |
9 | t.test_files = test_files | 9 | t.test_files = test_files |
10 | t.verbose = true | 10 | t.verbose = true |
11 | end | 11 | end |
12 | end | 12 | end |
13 | 13 | ||
14 | +task 'db:test:plugins:prepare' do | ||
15 | + Rake::Task['db:test:prepare'].invoke | ||
16 | + sh 'rake db:migrate RAILS_ENV=test SCHEMA=/dev/null' | ||
17 | +end | ||
18 | + | ||
14 | namespace :test do | 19 | namespace :test do |
15 | namespace :noosfero_plugins do | 20 | namespace :noosfero_plugins do |
16 | tasks = [ | 21 | tasks = [ |