Skip to content
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
4 changes: 3 additions & 1 deletion sentry-ruby/.rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
--format documentation
--require spec_helper
--format progress
--color
--order rand
11 changes: 5 additions & 6 deletions sentry-ruby/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ Bundler::GemHelper.install_tasks(name: "sentry-ruby")

require "rspec/core/rake_task"

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

RSpec::Core::RakeTask.new(:spec).tap do |task|
task.rspec_opts = "--order rand"
task.exclude_pattern = "spec/isolated/**/*_spec.rb"
task.exclude_pattern = ISOLATED_SPECS
end

task :isolated_specs do
Dir["spec/isolated/**/*_spec.rb"].each do |file|
sh "bundle exec rspec #{file}"
end
RSpec::Core::RakeTask.new(:isolated_specs).tap do |task|
task.pattern = ISOLATED_SPECS
end

task default: [:spec, :isolated_specs]
2 changes: 0 additions & 2 deletions sentry-ruby/spec/initialization_check_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe "with uninitialized SDK" do
before do
# completely nuke any initialized hubs
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/isolated/init_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require_relative "../spec_helper"

# isolated tests need a SimpleCov name otherwise they will overwrite coverage
SimpleCov.command_name "RSpecIsolatedInit"

Expand Down
4 changes: 3 additions & 1 deletion sentry-ruby/spec/isolated/puma_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

require "puma"
require_relative "../spec_helper"

# Force-load the patches so that we don't depend on require order
load Pathname(__FILE__).join("../../../lib/sentry/puma.rb").realpath

# Because puma doesn't have any dependency, if Rack is not installed the entire test won't work
return if ENV["RACK_VERSION"] == "0"
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/background_worker_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::BackgroundWorker do
let(:string_io) { StringIO.new }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/backpressure_monitor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::BackpressureMonitor do
let(:string_io) { StringIO.new }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/backtrace/lines_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::Backtrace::Line do
before do
perform_basic_setup
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/backtrace_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Backtrace do
let(:fixture_root) { File.join(Dir.pwd, "spec", "support") }
let(:fixture_file) { File.join(fixture_root, "stacktrace_test_fixture.rb") }
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/baggage_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::Baggage do
let(:malformed_baggage) { "," }
let(:third_party_baggage) { "other-vendor-value-1=foo;bar;baz, other-vendor-value-2=foo;bar;" }
Expand Down
1 change: 0 additions & 1 deletion sentry-ruby/spec/sentry/breadcrumb/http_logger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require "spec_helper"
require 'contexts/with_request_mock'

RSpec.describe :http_logger do
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/breadcrumb/redis_logger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe :redis_logger do
let(:redis) { Redis.new(host: REDIS_HOST) }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/breadcrumb/sentry_logger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe "Sentry::Breadcrumbs::SentryLogger" do
before do
perform_basic_setup do |config|
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/breadcrumb_buffer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::BreadcrumbBuffer do
before do
perform_basic_setup
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/breadcrumb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::Breadcrumb do
let(:stringio) { StringIO.new }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/client/event_sending_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Client do
let(:configuration) do
Sentry::Configuration.new.tap do |config|
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/client_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

class ExceptionWithContext < StandardError
def sentry_context
{
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/configuration_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Configuration do
describe "#capture_exception_frame_locals" do
it "passes/received the value to #include_local_variables" do
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/cron/monitor_check_ins_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Cron::MonitorCheckIns do
before { perform_basic_setup }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/cron/monitor_config_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Cron::MonitorConfig do
before { perform_basic_setup }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/cron/monitor_schedule_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Cron::MonitorSchedule::Crontab do
let(:subject) { described_class.new('5 * * * *') }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/dsn_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::DSN do
subject do
described_class.new(
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/envelope/item_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::Envelope::Item do
describe '.data_category' do
[
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/event_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Event do
let(:configuration) do
Sentry::Configuration.new.tap do |config|
Expand Down
1 change: 0 additions & 1 deletion sentry-ruby/spec/sentry/excon_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require "spec_helper"
require "contexts/with_request_mock"
require "excon"

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/graphql_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

with_graphql = begin
require 'graphql'
true
Expand Down
3 changes: 0 additions & 3 deletions sentry-ruby/spec/sentry/hub_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Hub do
let(:string_io) { StringIO.new }
let(:logger) do
Expand Down Expand Up @@ -260,7 +258,6 @@
end
end


it "raises error when passing a non-exception object" do
expect do
subject.capture_exception("String")
Expand Down
1 change: 0 additions & 1 deletion sentry-ruby/spec/sentry/integrable_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require "spec_helper"
require "sentry/integrable"

RSpec.describe Sentry::Integrable do
Expand Down
1 change: 0 additions & 1 deletion sentry-ruby/spec/sentry/interface_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'
require 'sentry/interface'

class TestInterface < Sentry::Interface
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/interfaces/request_interface_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

return unless defined?(Rack)

RSpec.describe Sentry::RequestInterface do
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/interfaces/stacktrace_builder_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::StacktraceBuilder do
let(:fixture_root) { File.join(Dir.pwd, "spec", "support") }
let(:fixture_file) { File.join(fixture_root, "stacktrace_test_fixture.rb") }
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/interfaces/stacktrace_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::StacktraceInterface::Frame do
describe "#initialize" do
let(:configuration) { Sentry::Configuration.new }
Expand Down
1 change: 0 additions & 1 deletion sentry-ruby/spec/sentry/linecache_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'
# rubocop:disable Style/WordArray
RSpec.describe Sentry::LineCache do
describe "#get_file_context" do
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/log_event_buffer_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::LogEventBuffer do
subject(:log_event_buffer) { described_class.new(Sentry.configuration, client) }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/log_event_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::LogEvent do
let(:configuration) do
Sentry::Configuration.new.tap do |config|
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/aggregator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::Aggregator do
let(:string_io) { StringIO.new }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/configuration_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::Configuration do
describe '#before_emit=' do
it 'raises error when setting before_emit to anything other than callable or nil' do
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/counter_metric_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::CounterMetric do
subject { described_class.new(1) }
before { subject.add(2) }
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/distribution_metric_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::DistributionMetric do
subject { described_class.new(1) }
before { subject.add(2) }
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/gauge_metric_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::GaugeMetric do
subject { described_class.new(0) }
before { 9.times { |i| subject.add(i + 1) } }
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/local_aggregator_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::LocalAggregator do
let(:tags) { [['foo', 1], ['foo', 2], ['bar', 'baz']] }
let(:key) { [:c, 'incr', 'second', tags] }
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/metric_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::Metric do
describe '#add' do
it 'raises not implemented error' do
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/set_metric_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::SetMetric do
subject { described_class.new('foo') }

Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics/timing_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics::Timing do
let(:fake_time) { Time.new(2024, 1, 2, 3, 4, 5) }
before { allow(Time).to receive(:now).and_return(fake_time) }
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/metrics_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Sentry::Metrics do
before do
perform_basic_setup do |config|
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/net/http_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require "spec_helper"
require 'contexts/with_request_mock'

RSpec.describe Sentry::Net::HTTP do
Expand Down Expand Up @@ -113,7 +112,6 @@
transaction = Sentry.start_transaction
Sentry.get_current_scope.set_span(transaction)


response = http.request(request)

expect(response.code).to eq("200")
Expand Down
2 changes: 0 additions & 2 deletions sentry-ruby/spec/sentry/profiler_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe Sentry::Profiler, when: :stack_prof_installed? do
before do
perform_basic_setup do |config|
Expand Down
Loading
Loading