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
8 changes: 3 additions & 5 deletions spec/datadog/tracing/contrib/ethon/easy_patch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
require 'datadog/tracing/contrib/ethon/shared_examples'
require 'datadog/tracing/contrib/analytics_examples'

require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'

RSpec.describe Datadog::Tracing::Contrib::Ethon::EasyPatch do
let(:configuration_options) { {} }
let(:easy) { EthonSupport.ethon_easy_new }
let(:easy) { Ethon::Easy.new }
let(:server_error_statuses) { nil }

before do
Expand Down Expand Up @@ -252,7 +250,7 @@

context 'when basic auth in url' do
it 'does not collect auth info' do
easy = EthonSupport.ethon_easy_new(url: 'http://username:[email protected]/sample/path')
easy = Ethon::Easy.new(url: 'http://username:[email protected]/sample/path')

easy.perform

Expand All @@ -263,7 +261,7 @@

context 'when query string in url' do
it 'does not collect query string' do
easy = EthonSupport.ethon_easy_new(url: 'http://example.com/sample/path?foo=bar')
easy = Ethon::Easy.new(url: 'http://example.com/sample/path?foo=bar')

easy.perform

Expand Down
8 changes: 3 additions & 5 deletions spec/datadog/tracing/contrib/ethon/integration_test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
require 'datadog/tracing/contrib/support/spec_helper'
require 'datadog/tracing/contrib/support/http'

require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'

RSpec.describe 'Ethon integration tests' do
skip_unless_integration_testing_enabled

context 'with Easy HTTP request' do
subject(:request) do
easy = EthonSupport.ethon_easy_new
easy = Ethon::Easy.new
easy.http_request(url, 'GET', params: query, timeout_ms: timeout * 1000)
easy.perform
# Use Typhoeus response wrapper to simplify tests
Expand Down Expand Up @@ -67,7 +65,7 @@

context 'with simple Easy & headers override' do
subject(:request) do
easy = EthonSupport.ethon_easy_new(url: url)
easy = Ethon::Easy.new(url: url)
easy.customrequest = 'GET'
easy.set_attributes(timeout_ms: timeout * 1000)
easy.headers = request_headers
Expand Down Expand Up @@ -104,7 +102,7 @@
context 'with single Multi request' do
subject(:request) do
multi = Ethon::Multi.new
easy = EthonSupport.ethon_easy_new
easy = Ethon::Easy.new
easy.http_request(url, 'GET', params: query, timeout_ms: timeout * 1000)
multi.add(easy)
multi.perform
Expand Down
6 changes: 2 additions & 4 deletions spec/datadog/tracing/contrib/ethon/multi_patch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
require 'datadog/tracing/contrib/environment_service_name_examples'
require 'datadog/tracing/contrib/span_attribute_schema_examples'

require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'

RSpec.describe Datadog::Tracing::Contrib::Ethon::MultiPatch do
let(:configuration_options) { {} }

Expand All @@ -26,7 +24,7 @@
end

describe '#add' do
let(:easy) { EthonSupport.ethon_easy_new }
let(:easy) { Ethon::Easy.new }
let(:span) { easy.instance_eval { @datadog_span } }
let(:multi_span) { multi.instance_eval { @datadog_multi_span } }
let(:multi) { ::Ethon::Multi.new }
Expand Down Expand Up @@ -61,7 +59,7 @@
end

describe '#perform' do
let(:easy) { EthonSupport.ethon_easy_new }
let(:easy) { Ethon::Easy.new }
let(:easy_span) { spans.find { |span| span.name == 'ethon.request' } }
let(:multi_span) { spans.find { |span| span.name == 'ethon.multi.request' } }
let(:multi) { ::Ethon::Multi.new }
Expand Down
22 changes: 0 additions & 22 deletions spec/datadog/tracing/contrib/ethon/support/thread_helpers.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require 'datadog/tracing/contrib/ethon/shared_examples'
require 'datadog/tracing/contrib/ethon/integration_context'
require 'spec/datadog/tracing/contrib/ethon/support/thread_helpers'

RSpec.describe Datadog::Tracing::Contrib::Ethon do
skip_unless_integration_testing_enabled
Expand All @@ -18,7 +17,7 @@
#
# This allows us to still ensure that the integration
# itself is leak-free.
EthonSupport.ethon_easy_new
Ethon::Easy.new
end

context 'with Typhoeus request' do
Expand Down