Project

General

Profile

Defect #39803 » 39803.patch

Marius BĂLTEANU, 2023-12-17 04:46

View differences:

Gemfile
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"
lib/tasks/redmine.rake
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
test/unit/project_nested_set_concurrency_test.rb
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
(3-3/3)