From c38e847fa656e4007e44e7ee882e0abf105be8cb Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Tue, 12 Dec 2023 16:52:46 +0000 Subject: [PATCH] Fix NoMethodError: undefined method `rake_run' for Rails::TestUnit::Runner:Class (NoMethodError) after updating to Rails 7.1 (#36320, #39803) Patch by @tohosaku. git-svn-id: https://svn.redmine.org/redmine/trunk@22517 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/tasks/redmine.rake | 10 +++++----- lib/tasks/testing.rake | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/tasks/redmine.rake b/lib/tasks/redmine.rake index b3c2f0122..aa86d3532 100644 --- a/lib/tasks/redmine.rake +++ b/lib/tasks/redmine.rake @@ -179,31 +179,31 @@ DESC desc 'Runs the plugins unit tests.' task :units => "db:test:prepare" do |t| $: << "test" - Rails::TestUnit::Runner.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb"] + Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/unit/**/*_test.rb"] end desc 'Runs the plugins functional tests.' task :functionals => "db:test:prepare" do |t| $: << "test" - Rails::TestUnit::Runner.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb"] + Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/functional/**/*_test.rb"] end desc 'Runs the plugins integration tests.' task :integration => "db:test:prepare" do |t| $: << "test" - Rails::TestUnit::Runner.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb"] + Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/integration/**/*_test.rb"] end desc 'Runs the plugins system tests.' task :system => "db:test:prepare" do |t| $: << "test" - Rails::TestUnit::Runner.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/system/**/*_test.rb"] + Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/system/**/*_test.rb"] end desc 'Runs the plugins ui tests.' task :ui => "db:test:prepare" do |t| $: << "test" - Rails::TestUnit::Runner.rake_run ["plugins/#{ENV['NAME'] || '*'}/test/ui/**/*_test.rb"] + Rails::TestUnit::Runner.run_from_rake 'test', ["plugins/#{ENV['NAME'] || '*'}/test/ui/**/*_test.rb"] end end end diff --git a/lib/tasks/testing.rake b/lib/tasks/testing.rake index 1961ff688..5b5cedb46 100644 --- a/lib/tasks/testing.rake +++ b/lib/tasks/testing.rake @@ -98,20 +98,20 @@ namespace :test do task(:units => "db:test:prepare") do |t| $: << "test" - Rails::TestUnit::Runner.rake_run FileList['test/unit/repository*_test.rb'] + FileList['test/unit/lib/redmine/scm/**/*_test.rb'] + Rails::TestUnit::Runner.run_from_rake 'test', 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" task(:functionals => "db:test:prepare") do |t| $: << "test" - Rails::TestUnit::Runner.rake_run FileList['test/functional/repositories*_test.rb'] + Rails::TestUnit::Runner.run_from_rake 'test', FileList['test/functional/repositories*_test.rb'] end Rake::Task['test:scm:functionals'].comment = "Run the scm functional tests" end task(:routing) do |t| $: << "test" - Rails::TestUnit::Runner.rake_run FileList['test/integration/routing/*_test.rb'] + FileList['test/integration/api_test/*_routing_test.rb'] + Rails::TestUnit::Runner.run_from_rake 'test', FileList['test/integration/routing/*_test.rb'] + FileList['test/integration/api_test/*_routing_test.rb'] end Rake::Task['test:routing'].comment = "Run the routing tests" end -- 2.39.5