From ed3ec53dbd66535a7b59b8f75ee4b1e3ba69cd00 Mon Sep 17 00:00:00 2001 From: zzak Date: Fri, 1 Nov 2024 12:59:03 +0900 Subject: [PATCH 1/2] Remove circular require for resque from resque-scheduler This resolves the following warning: ``` BUNDLE_GEMFILE=test/gemfiles/Gemfile-rails-main bundle exec rake test:activejob /home/zzak/.rbenv/versions/3.3.5/bin/ruby -w -I"lib:test:lib:test/active_job" /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader .rb "test/active_job/cases/adapter_test.rb" Using resque /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75: warning: loading in progress , circular require considered harmful - /home/zzak/code/resque/lib/active_job/queue_adapters/resque_adapter.rb from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `
' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `select' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21:in `block in
' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/code/resque/test/active_job/cases/adapter_test.rb:3:in `' from /home/zzak/code/resque/test/active_job/cases/adapter_test.rb:3:in `require_relative' from /home/zzak/code/resque/test/active_job/helper.rb:15:in `' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/code/resque/test/active_job/adapters/resque.rb:3:in `' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-9de4972adee8/activesupport/lib/active_support/lazy_load_hooks.rb:61:in `on_load' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-9de4972adee8/activesupport/lib/active_support/lazy_load_hooks.rb:61:in `each' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-9de4972adee8/activesupport/lib/active_support/lazy_load_hooks.rb:62:in `block in on_loa d' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-9de4972adee8/activesupport/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-9de4972adee8/activesupport/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_ control' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-9de4972adee8/activesupport/lib/active_support/lazy_load_hooks.rb:97:in `block in execut e_hook' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rails-9de4972adee8/activesupport/lib/active_support/lazy_load_hooks.rb:97:in `class_eval' from /home/zzak/code/resque/test/active_job/adapters/resque.rb:4:in `block in ' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/code/resque/lib/active_job/queue_adapters/resque_adapter.rb:7:in `' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/code/resque-scheduler/lib/resque-scheduler.rb:4:in `' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/code/resque-scheduler/lib/resque/scheduler/extension.rb:4:in `' from /home/zzak/code/resque-scheduler/lib/resque/scheduler/extension.rb:4:in `require_relative' from /home/zzak/code/resque-scheduler/lib/resque/scheduler/delaying_extensions.rb:2:in `' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' from /home/zzak/code/resque/lib/resque.rb:27:in `' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require' from /home/zzak/.rbenv/versions/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require' Run options: --seed 11193 # Running: . Finished in 0.002215s, 451.5588 runs/s, 451.5588 assertions/s. 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips ``` --- lib/resque/scheduler/delaying_extensions.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/resque/scheduler/delaying_extensions.rb b/lib/resque/scheduler/delaying_extensions.rb index 5a13cb41..e2df0baa 100644 --- a/lib/resque/scheduler/delaying_extensions.rb +++ b/lib/resque/scheduler/delaying_extensions.rb @@ -1,5 +1,4 @@ # vim:fileencoding=utf-8 -require 'resque' require_relative 'plugin' require_relative '../scheduler' From 571a3aaadab5695bf03490a0f6063a1017612cdf Mon Sep 17 00:00:00 2001 From: zzak Date: Fri, 1 Nov 2024 13:10:15 +0900 Subject: [PATCH 2/2] Fix CI --- test/resque-web_test.rb | 4 ++-- test/scheduler_test.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/resque-web_test.rb b/test/resque-web_test.rb index 7ec1b7c3..b2839e2b 100644 --- a/test/resque-web_test.rb +++ b/test/resque-web_test.rb @@ -307,7 +307,7 @@ module Test test 'redirects to overview' do post '/delayed/cancel_now' assert last_response.status == 302 - assert last_response.header['Location'].include? '/delayed' + assert last_response.headers['Location'].include? '/delayed' end end @@ -316,7 +316,7 @@ module Test test 'redirects to delayed' do assert last_response.status == 302 - assert last_response.header['Location'].include? '/delayed' + assert last_response.headers['Location'].include? '/delayed' end end diff --git a/test/scheduler_test.rb b/test/scheduler_test.rb index ab47461d..d7a4208d 100644 --- a/test/scheduler_test.rb +++ b/test/scheduler_test.rb @@ -1,5 +1,6 @@ # vim:fileencoding=utf-8 require_relative 'test_helper' +require 'ostruct' context 'Resque::Scheduler' do setup do