From dba222e68868f9917cc4feb6891268a9b971c3a7 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 10 Nov 2022 15:10:15 +1300 Subject: [PATCH 1/2] Test with traces enabled. --- async-http.gemspec | 2 +- lib/async/http/client.rb | 2 +- spec/spec_helper.rb | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/async-http.gemspec b/async-http.gemspec index 0297c84d..59da15ee 100644 --- a/async-http.gemspec +++ b/async-http.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| spec.add_dependency "protocol-http", "~> 0.23.1" spec.add_dependency "protocol-http1", "~> 0.14.0" spec.add_dependency "protocol-http2", "~> 0.14.0" - spec.add_dependency "traces", ">= 0.4.0" + spec.add_dependency "traces", ">= 0.8.0" spec.add_development_dependency "async-container", "~> 0.14" spec.add_development_dependency "async-rspec", "~> 1.10" diff --git a/lib/async/http/client.rb b/lib/async/http/client.rb index bc350490..80b454da 100755 --- a/lib/async/http/client.rb +++ b/lib/async/http/client.rb @@ -161,7 +161,7 @@ def call(request) end trace('async.http.client.call', attributes: attributes) do |span| - if context = trace_context(span) + if context = self.trace_context request.headers['traceparent'] = context.to_s # request.headers['tracestate'] = context.state end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8cb621f5..cb68221e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,6 +25,8 @@ require 'async/rspec' +ENV['TRACES_BACKEND'] ||= 'traces/backend/test' + RSpec.shared_context 'docstring as description' do let(:description) {self.class.metadata.fetch(:description_args).first} end From 2dda7c866af8035bad33f8ea5f43087041c8e5f2 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 10 Nov 2022 16:57:11 +1300 Subject: [PATCH 2/2] Fix external tests. --- config/external.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/external.yaml b/config/external.yaml index b41c35b2..663e3e16 100644 --- a/config/external.yaml +++ b/config/external.yaml @@ -6,7 +6,7 @@ async-rest: command: bundle exec rspec async-websocket: url: https://github.com/socketry/async-websocket.git - command: bundle exec rspec + command: bundle exec sus async-http-faraday: url: https://github.com/socketry/async-http-faraday.git command: bundle exec rspec