Skip to content

Commit

Permalink
refactor: fix test directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
arielvalentin committed Oct 8, 2023
1 parent a39ce1b commit 2ecca7e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,18 @@ def finish(_name, _id, payload)
rescue StandardError => e
OpenTelemetry.handle_error(exception: e)
ensure
finish_span(span, tokens)
end

def finish_span(span, tokens)
# closes the span after all attributes have been finalized
begin
span&.finish
rescue StandardError => e
OpenTelemetry.handle_error(exception: e)
end

# pops the context stack
tokens&.reverse&.each do |token|
OpenTelemetry::Context.detach(token)
rescue StandardError => e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

require 'test_helper'

require_relative '../../../lib/opentelemetry/instrumentation/active_job'
require_relative '../../../../lib/opentelemetry/instrumentation/active_job'

describe OpenTelemetry::Instrumentation::ActiveJob do
let(:instrumentation) { OpenTelemetry::Instrumentation::ActiveJob::Instrumentation.instance }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

require 'test_helper'

require_relative '../../../../lib/opentelemetry/instrumentation/active_job'
require_relative '../../../../../lib/opentelemetry/instrumentation/active_job'

describe OpenTelemetry::Instrumentation::ActiveJob::Patches::Base do
describe 'serialization / deserialization' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

require 'test_helper'

require_relative '../../../lib/opentelemetry/instrumentation/active_job'
require_relative '../../../../lib/opentelemetry/instrumentation/active_job'

describe OpenTelemetry::Instrumentation::ActiveJob::Subscriber do
let(:instrumentation) { OpenTelemetry::Instrumentation::ActiveJob::Instrumentation.instance }
Expand Down

0 comments on commit 2ecca7e

Please sign in to comment.