Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests with Rails default configuration to enable Zeitwerk #190

Merged
merged 1 commit into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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