Skip to content

Commit

Permalink
squash: remove global state causing routes to be stale
Browse files Browse the repository at this point in the history
  • Loading branch information
arielvalentin committed Nov 19, 2024
1 parent b982c1e commit ee4690a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'opentelemetry-sdk', '~> 1.1'
spec.add_development_dependency 'opentelemetry-test-helpers', '~> 0.3'
spec.add_development_dependency 'rails', '>= 6.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rubocop', '~> 1.68.0'
spec.add_development_dependency 'rubocop-performance', '~> 1.22.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
let(:exporter) { EXPORTER }
let(:spans) { exporter.finished_spans }
let(:span) { exporter.finished_spans.last }
let(:rails_app) { DEFAULT_RAILS_APP }
let(:rails_app) { AppConfig.initialize_app }
let(:config) { {} }

# Clear captured spans
Expand Down
5 changes: 0 additions & 5 deletions instrumentation/action_pack/test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,3 @@
c.use 'OpenTelemetry::Instrumentation::ActionPack'
c.add_span_processor span_processor
end

# Create a globally available Rails app, this should be used in test unless
# specifically testing behaviour with different initialization configs.
DEFAULT_RAILS_APP = AppConfig.initialize_app
Rails.application = DEFAULT_RAILS_APP
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#
# SPDX-License-Identifier: Apache-2.0

class Application < Rails::Application; end
require 'action_controller/railtie'
class Application < Rails::Application; end
require_relative 'middlewares'
require_relative 'controllers'
require_relative 'routes'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ def new_item
end

def internal_server_error
raise :internal_server_error
raise 'internal_server_error'
end
end

0 comments on commit ee4690a

Please sign in to comment.