From f8d752719c34219a7784352d4bda1fd7d3396e1f Mon Sep 17 00:00:00 2001 From: st0012 Date: Wed, 10 Mar 2021 14:30:42 +0800 Subject: [PATCH 1/2] Test sentry-rails integraion in a separate process Most of the sentry-sidekiq tests should be run without sentry-rails and rails. And since there's no easy way to unload those gems in a RSpec process, we should use 2 processes to test them separately. --- sentry-sidekiq/Makefile | 4 ++++ sentry-sidekiq/spec/sentry/rails_spec.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/sentry-sidekiq/Makefile b/sentry-sidekiq/Makefile index 62ad039eb..2e9d7ea98 100644 --- a/sentry-sidekiq/Makefile +++ b/sentry-sidekiq/Makefile @@ -1,3 +1,7 @@ build: bundle install gem build sentry-sidekiq.gemspec + +test: + bundle exec rspec + WITH_SENTRY_RAILS=1 bundle exec rspec spec/sentry/rails_spec.rb diff --git a/sentry-sidekiq/spec/sentry/rails_spec.rb b/sentry-sidekiq/spec/sentry/rails_spec.rb index deb94b062..903f8ab38 100644 --- a/sentry-sidekiq/spec/sentry/rails_spec.rb +++ b/sentry-sidekiq/spec/sentry/rails_spec.rb @@ -1,3 +1,5 @@ +return unless ENV["WITH_SENTRY_RAILS"] + require "rails" require "sentry-rails" require "spec_helper" From c62bc8f340eb0778db16f95df1beb03cbe809c76 Mon Sep 17 00:00:00 2001 From: st0012 Date: Wed, 10 Mar 2021 14:33:07 +0800 Subject: [PATCH 2/2] Use make test for running sentry-sidekiq's specs on CI --- .github/workflows/sentry_sidekiq_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sentry_sidekiq_test.yml b/.github/workflows/sentry_sidekiq_test.yml index bb09d281d..a8c01a9f7 100644 --- a/.github/workflows/sentry_sidekiq_test.yml +++ b/.github/workflows/sentry_sidekiq_test.yml @@ -40,4 +40,4 @@ jobs: - name: Run specs run: | bundle install --jobs 4 --retry 3 - bundle exec rake + make test