Skip to content

Commit

Permalink
add test failure message to otel status description
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisholmes authored Nov 15, 2021
1 parent 401ea08 commit fada1ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def example_finished(notification)
if (exception = result.exception)
span.record_exception(exception)
span.set_attribute('rspec.example.failure_message', exception.message) if exception.is_a? ::RSpec::Expectations::ExpectationNotMetError
span.status = OpenTelemetry::Trace::Status.error
span.status = OpenTelemetry::Trace::Status.error(exception.message)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def run_example(&blk)
\e[0m
MESSAGE
_(subject.attributes['rspec.example.failure_message']).must_equal message
_(subject.status.description).must_equal message
_(subject.events.first.attributes['exception.message']).must_equal message
end

Expand Down

0 comments on commit fada1ae

Please sign in to comment.