Project

General

Profile

Defect #39803 » 39803.patch

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

View differences:

Gemfile
3 3
ruby '>= 2.7.0', '< 3.3.0'
4 4

  
5 5
gem 'rails', '7.1.2'
6
gem 'rack-session', '~> 1.0'
7 6
gem 'rouge', '~> 4.2.0'
8 7
gem 'mini_mime', '~> 1.1.0'
9 8
gem "actionpack-xml_parser"
lib/tasks/redmine.rake
178 178
    namespace :test do
179 179
      desc 'Runs the plugins unit tests.'
180 180
      task :units => "db:test:prepare" do |t|
181
        $: << "test"
182
        Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb"]
181
        pattern = "plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb"
182
        if Dir.glob(pattern).any?
183
          $: << "test"
184
          Rails::TestUnit::Runner.run_from_rake 'test', [pattern]
185
        end
183 186
      end
184 187

  
185 188
      desc 'Runs the plugins functional tests.'
186 189
      task :functionals => "db:test:prepare" do |t|
187
        $: << "test"
188
        Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb"]
190
        pattern = "plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb"
191
        if Dir.glob(pattern).any?
192
          $: << "test"
193
          Rails::TestUnit::Runner.run_from_rake 'test', [pattern]
194
        end
189 195
      end
190 196

  
191 197
      desc 'Runs the plugins integration tests.'
192 198
      task :integration => "db:test:prepare" do |t|
193
        $: << "test"
194
        Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb"]
199
        pattern = "plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb"
200
        if Dir.glob(pattern).any?
201
          $: << "test"
202
          Rails::TestUnit::Runner.run_from_rake 'test', [pattern]
203
        end
195 204
      end
196 205

  
197 206
      desc 'Runs the plugins system tests.'
198 207
      task :system => "db:test:prepare" do |t|
199
        $: << "test"
200
        Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/system/**/*_test.rb"]
208
        pattern = "plugins/#{ENV['NAME'] || '*'}/test/system/**/*_test.rb"
209
        if Dir.glob(pattern).any?
210
          $: << "test"
211
          Rails::TestUnit::Runner.run_from_rake 'test', [pattern]
212
        end
201 213
      end
202 214

  
203 215
      desc 'Runs the plugins ui tests.'
204 216
      task :ui => "db:test:prepare" do |t|
205
        $: << "test"
206
        Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/ui/**/*_test.rb"]
217
        pattern = "plugins/#{ENV['NAME'] || '*'}/test/ui/**/*_test.rb"
218
        if Dir.glob(pattern).any?
219
          $: << "test"
220
          Rails::TestUnit::Runner.run_from_rake 'test', [pattern]
221
        end
207 222
      end
208 223
    end
209 224
  end
test/unit/project_nested_set_concurrency_test.rb
38 38
    p = generate_project!
39 39
    p.destroy
40 40

  
41
    assert_difference 'Project.count', 60 do
41
    assert_difference 'Project.async_count.value', 60 do
42 42
      threads = []
43 43
      3.times do |i|
44 44
        threads << Thread.new(i) do
(3-3/3)