Skip to content

Commit 315a21e

Browse files
committed
chore(sidekiq): move rails_spec to spec:isolated group
1 parent 3b9838d commit 315a21e

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

sentry-sidekiq/spec/sentry/rails_spec.rb renamed to sentry-sidekiq/spec/isolated/rails_spec.rb

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# frozen_string_literal: true
22

3-
return unless ENV["WITH_SENTRY_RAILS"]
4-
5-
require "logger"
3+
begin
4+
require "simplecov"
5+
SimpleCov.command_name "SidekiqRails"
6+
rescue LoadError
7+
end
68

7-
require "rails"
89
require "sentry-rails"
9-
require "spec_helper"
1010

11-
require "action_controller/railtie"
11+
# This MUST be required after sentry-rails because it requires sentry-sidekiq
12+
# which checks if Railtie is defined to properly set things up
13+
require_relative "../spec_helper"
1214

1315
class TestApp < Rails::Application
1416
end
@@ -23,15 +25,9 @@ def self.name
2325
app.config.hosts = nil
2426
app.config.secret_key_base = "test"
2527
app.config.eager_load = false
28+
2629
app.initializer :configure_sentry do
27-
Sentry.init do |config|
28-
config.release = 'beta'
29-
config.dsn = "dummy://12345:[email protected]:3000/sentry/42"
30-
config.transport.transport_class = Sentry::DummyTransport
31-
# for sending events synchronously
32-
config.background_worker_threads = 0
33-
yield(config, app) if block_given?
34-
end
30+
perform_basic_setup
3531
end
3632

3733
app.initialize!

0 commit comments

Comments
 (0)