Skip to content

Commit

Permalink
constrain DI integration tests to configurations on which DI works
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Jan 13, 2025
1 parent 9e71209 commit 93abf05
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions integration/apps/rails-five/spec/integration/di_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

RSpec.describe 'Dynamic Instrumentation' do
include_context 'integration test'
di_test

describe 'ActiveRecord integration' do
subject { JSON.parse(get('di/ar_serializer').body) }
Expand Down
19 changes: 19 additions & 0 deletions integration/apps/rails-five/spec/support/integration_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,23 @@ def get(path)
Net::HTTP.get_response(uri)
end
end

module ClassMethods
def di_test
if RUBY_ENGINE == 'jruby'
before(:all) do
skip "Dynamic instrumentation is not supported on JRuby"
end
end
if RUBY_VERSION < "2.6"
before(:all) do
skip "Dynamic instrumentation requires Ruby 2.6 or higher"
end
end
end
end

def self.included(base)
base.extend(ClassMethods)
end
end
1 change: 1 addition & 0 deletions integration/apps/rails-seven/spec/integration/di_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

RSpec.describe 'Dynamic Instrumentation' do
include_context 'integration test'
di_test

describe 'ActiveRecord integration' do
subject { JSON.parse(get('di/ar_serializer').body) }
Expand Down
19 changes: 19 additions & 0 deletions integration/apps/rails-seven/spec/support/integration_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,23 @@ def get(path)
Net::HTTP.get_response(uri)
end
end

module ClassMethods
def di_test
if RUBY_ENGINE == 'jruby'
before(:all) do
skip "Dynamic instrumentation is not supported on JRuby"
end
end
if RUBY_VERSION < "2.6"
before(:all) do
skip "Dynamic instrumentation requires Ruby 2.6 or higher"
end
end
end
end

def self.included(base)
base.extend(ClassMethods)
end
end
1 change: 1 addition & 0 deletions integration/apps/rails-six/spec/integration/di_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

RSpec.describe 'Dynamic Instrumentation' do
include_context 'integration test'
di_test

describe 'ActiveRecord integration' do
subject { JSON.parse(get('di/ar_serializer').body) }
Expand Down
19 changes: 19 additions & 0 deletions integration/apps/rails-six/spec/support/integration_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,23 @@ def get(path)
Net::HTTP.get_response(uri)
end
end

module ClassMethods
def di_test
if RUBY_ENGINE == 'jruby'
before(:all) do
skip "Dynamic instrumentation is not supported on JRuby"
end
end
if RUBY_VERSION < "2.6"
before(:all) do
skip "Dynamic instrumentation requires Ruby 2.6 or higher"
end
end
end
end

def self.included(base)
base.extend(ClassMethods)
end
end

0 comments on commit 93abf05

Please sign in to comment.