Skip to content

Commit

Permalink
Merge pull request #190 from bensheldon/zeitwerk
Browse files Browse the repository at this point in the history
Run tests with Rails default configuration to enable Zeitwerk
  • Loading branch information
bensheldon authored Dec 30, 2020
2 parents bed770d + be0c5a0 commit 4c9a154
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spec/test_app/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module TestApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
# config.load_defaults 6.0
config.load_defaults Gem::Version.new(Rails.version).segments.slice(0..1).join('.').to_f

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
Expand Down
9 changes: 0 additions & 9 deletions spec/test_app/config/initializers/good_job.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
if ENV['RBTRACE']
require 'sigdump/setup'
require 'rbtrace'
sleep 1
$stdout.puts "Run $ bundle exec rbtrace --pid #{Process.pid} --firehose"
$stdout.puts 'Press Enter to continue'
$stdin.gets
end

if ENV['GOOD_JOB_EXECUTION_MODE'].present?
ActiveJob::Base.queue_adapter = :good_job
end
10 changes: 10 additions & 0 deletions spec/test_app/config/initializers/rbtrace.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if ENV['RBTRACE']
require 'sigdump/setup'
require 'rbtrace'
sleep 1
$stdout.puts "Enabled rbtrace. Example commands:"
$stdout.puts " Show all method calls: $ bundle exec rbtrace --pid #{Process.pid} --firehose"
$stdout.puts " Debug Rails deadlock: $ bundle exec rbtrace --pid #{Process.pid} --eval \"puts output = ActionDispatch::DebugLocks.new(nil).send(:render_details, nil); output\""
$stdout.puts 'Press Enter to continue...'
$stdin.gets
end

0 comments on commit 4c9a154

Please sign in to comment.