Skip to content
Draft
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: 0 additions & 2 deletions .github/workflows/sentry_sidekiq_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ jobs:
redis-version: ${{ (contains(matrix.sidekiq_version, '7.0') || contains(matrix.sidekiq_version, '8.0')) && 6 || 5 }}

- name: Run specs with Sidekiq ${{ matrix.sidekiq_version }}
env:
WITH_SENTRY_RAILS: 1
run: bundle exec rake

- name: Upload Coverage
Expand Down
1 change: 1 addition & 0 deletions sentry-sidekiq/.rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--require spec_helper
--format documentation
--color
19 changes: 13 additions & 6 deletions sentry-sidekiq/Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rake/clean"
require "bundler/gem_helper"

RSpec::Core::RakeTask.new(:spec).tap do |task|
task.rspec_opts = "--order rand"
end
Bundler::GemHelper.install_tasks(name: "sentry-sidekiq")

task default: :spec
require_relative "../lib/sentry/test/rake_tasks"

ISOLATED_SPECS = "spec/isolated/**/*_spec.rb"

Sentry::Test::RakeTasks.define_spec_tasks(
isolated_specs_pattern: ISOLATED_SPECS,
spec_exclude_pattern: ISOLATED_SPECS
)

task default: [:spec, :"spec:isolated"]
48 changes: 48 additions & 0 deletions sentry-sidekiq/spec/isolated/rails_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: true

begin
require "simplecov"
SimpleCov.command_name "SidekiqRails"
rescue LoadError
end

require "sentry-rails"

RSpec.describe Sentry::Sidekiq do
def make_basic_app
app = Class.new(Rails::Application) do
def self.name
"RailsTestApp"
end
end

app.config.hosts = nil
app.config.secret_key_base = "test"
app.config.eager_load = false

app.initializer :configure_sentry do
Sentry.init do |config|
config.release = 'beta'
config.dsn = "dummy://12345:[email protected]:3000/sentry/42"
config.transport.transport_class = Sentry::DummyTransport
# for sending events synchronously
config.background_worker_threads = 0
yield(config, app) if block_given?
end
end

app.initialize!
Rails.application = app
app
end

context "with default config" do
before do
make_basic_app
end

it "adds sidekiq adapter to config.rails.skippable_job_adapters" do
expect(Sentry.configuration.rails.skippable_job_adapters).to include("ActiveJob::QueueAdapters::SidekiqAdapter")
end
end
end
50 changes: 0 additions & 50 deletions sentry-sidekiq/spec/sentry/rails_spec.rb

This file was deleted.

Loading