Class: RSpec::Buildkite::Analytics::Uploader::Trace
- Inherits:
-
Object
- Object
- RSpec::Buildkite::Analytics::Uploader::Trace
- Defined in:
- lib/rspec/buildkite/analytics/uploader.rb
Instance Attribute Summary collapse
-
#example ⇒ Object
Returns the value of attribute example.
-
#failure_expanded ⇒ Object
Returns the value of attribute failure_expanded.
-
#failure_reason ⇒ Object
Returns the value of attribute failure_reason.
-
#history ⇒ Object
readonly
Returns the value of attribute history.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #as_hash ⇒ Object
-
#initialize(example, history) ⇒ Trace
constructor
A new instance of Trace.
- #result_state ⇒ Object
Constructor Details
#initialize(example, history) ⇒ Trace
Returns a new instance of Trace.
28 29 30 31 32 33 34 |
# File 'lib/rspec/buildkite/analytics/uploader.rb', line 28 def initialize(example, history) @id = SecureRandom.uuid @example = example @history = history @failure_reason = nil @failure_expanded = [] end |
Instance Attribute Details
#example ⇒ Object
Returns the value of attribute example.
25 26 27 |
# File 'lib/rspec/buildkite/analytics/uploader.rb', line 25 def example @example end |
#failure_expanded ⇒ Object
Returns the value of attribute failure_expanded.
25 26 27 |
# File 'lib/rspec/buildkite/analytics/uploader.rb', line 25 def @failure_expanded end |
#failure_reason ⇒ Object
Returns the value of attribute failure_reason.
25 26 27 |
# File 'lib/rspec/buildkite/analytics/uploader.rb', line 25 def failure_reason @failure_reason end |
#history ⇒ Object (readonly)
Returns the value of attribute history.
26 27 28 |
# File 'lib/rspec/buildkite/analytics/uploader.rb', line 26 def history @history end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
26 27 28 |
# File 'lib/rspec/buildkite/analytics/uploader.rb', line 26 def id @id end |
Instance Method Details
#as_hash ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/rspec/buildkite/analytics/uploader.rb', line 44 def as_hash strip_invalid_utf8_chars( id: @id, scope: example.example_group.[:full_description], name: example.description, identifier: example.id, location: example.location, file_name: generate_file_name(example), result: result_state, failure_reason: failure_reason, failure_expanded: , history: history, ).with_indifferent_access.compact end |
#result_state ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/rspec/buildkite/analytics/uploader.rb', line 36 def result_state case example.execution_result.status when :passed; "passed" when :failed; "failed" when :pending; "skipped" end end |