diff --git a/Gemfile b/Gemfile index d5870ad95..908c32343 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source 'https://rubygems.org' ruby '>= 2.7.0', '< 3.3.0' gem 'rails', '7.1.2' -gem 'rack-session', '~> 1.0' gem 'rouge', '~> 4.2.0' gem 'mini_mime', '~> 1.1.0' gem "actionpack-xml_parser" diff --git a/lib/tasks/redmine.rake b/lib/tasks/redmine.rake index aa86d3532..9d215eb72 100644 --- a/lib/tasks/redmine.rake +++ b/lib/tasks/redmine.rake @@ -178,32 +178,47 @@ DESC namespace :test do desc 'Runs the plugins unit tests.' task :units => "db:test:prepare" do |t| - $: << "test" - Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb"] + pattern = "plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb" + if Dir.glob(pattern).any? + $: << "test" + Rails::TestUnit::Runner.run_from_rake 'test', [pattern] + end end desc 'Runs the plugins functional tests.' task :functionals => "db:test:prepare" do |t| - $: << "test" - Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb"] + pattern = "plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb" + if Dir.glob(pattern).any? + $: << "test" + Rails::TestUnit::Runner.run_from_rake 'test', [pattern] + end end desc 'Runs the plugins integration tests.' task :integration => "db:test:prepare" do |t| - $: << "test" - Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb"] + pattern = "plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb" + if Dir.glob(pattern).any? + $: << "test" + Rails::TestUnit::Runner.run_from_rake 'test', [pattern] + end end desc 'Runs the plugins system tests.' task :system => "db:test:prepare" do |t| - $: << "test" - Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/system/**/*_test.rb"] + pattern = "plugins/#{ENV['NAME'] || '*'}/test/system/**/*_test.rb" + if Dir.glob(pattern).any? + $: << "test" + Rails::TestUnit::Runner.run_from_rake 'test', [pattern] + end end desc 'Runs the plugins ui tests.' task :ui => "db:test:prepare" do |t| - $: << "test" - Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/ui/**/*_test.rb"] + pattern = "plugins/#{ENV['NAME'] || '*'}/test/ui/**/*_test.rb" + if Dir.glob(pattern).any? + $: << "test" + Rails::TestUnit::Runner.run_from_rake 'test', [pattern] + end end end end diff --git a/test/unit/project_nested_set_concurrency_test.rb b/test/unit/project_nested_set_concurrency_test.rb index e835d2b50..077731040 100644 --- a/test/unit/project_nested_set_concurrency_test.rb +++ b/test/unit/project_nested_set_concurrency_test.rb @@ -38,7 +38,7 @@ class ProjectNestedSetConcurrencyTest < ActiveSupport::TestCase p = generate_project! p.destroy - assert_difference 'Project.count', 60 do + assert_difference 'Project.async_count.value', 60 do threads = [] 3.times do |i| threads << Thread.new(i) do