Class: Buildkite::TestCollector::MinitestPlugin::Trace
- Inherits:
-
Object
- Object
- Buildkite::TestCollector::MinitestPlugin::Trace
- Defined in:
- lib/buildkite/test_collector/minitest_plugin/trace.rb
Constant Summary collapse
- RESULT_CODES =
{ '.' => 'passed', 'F' => 'failed', 'E' => 'failed', 'S' => 'pending', }
- FILE_PATH_REGEX =
/^(.*?\.(rb|feature))/
Instance Attribute Summary collapse
-
#example ⇒ Object
Returns the value of attribute example.
-
#failure_expanded ⇒ Object
writeonly
Sets the attribute failure_expanded.
-
#failure_reason ⇒ Object
writeonly
Sets the attribute failure_reason.
-
#history ⇒ Object
readonly
Returns the value of attribute history.
Instance Method Summary collapse
- #as_hash ⇒ Object
-
#initialize(example, history:) ⇒ Trace
constructor
A new instance of Trace.
- #result ⇒ Object
- #source_location ⇒ Object
Constructor Details
#initialize(example, history:) ⇒ Trace
Returns a new instance of Trace.
18 19 20 21 |
# File 'lib/buildkite/test_collector/minitest_plugin/trace.rb', line 18 def initialize(example, history:) @example = example @history = history end |
Instance Attribute Details
#example ⇒ Object
Returns the value of attribute example.
5 6 7 |
# File 'lib/buildkite/test_collector/minitest_plugin/trace.rb', line 5 def example @example end |
#failure_expanded=(value) ⇒ Object
Sets the attribute failure_expanded
6 7 8 |
# File 'lib/buildkite/test_collector/minitest_plugin/trace.rb', line 6 def (value) @failure_expanded = value end |
#failure_reason=(value) ⇒ Object
Sets the attribute failure_reason
6 7 8 |
# File 'lib/buildkite/test_collector/minitest_plugin/trace.rb', line 6 def failure_reason=(value) @failure_reason = value end |
#history ⇒ Object (readonly)
Returns the value of attribute history.
7 8 9 |
# File 'lib/buildkite/test_collector/minitest_plugin/trace.rb', line 7 def history @history end |
Instance Method Details
#as_hash ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/buildkite/test_collector/minitest_plugin/trace.rb', line 31 def as_hash strip_invalid_utf8_chars( scope: example.class.name, name: example.name, location: location, file_name: file_name, result: result, failure_reason: failure_reason, failure_expanded: , history: history, ).select { |_, value| !value.nil? } end |
#result ⇒ Object
23 24 25 |
# File 'lib/buildkite/test_collector/minitest_plugin/trace.rb', line 23 def result RESULT_CODES[example.result_code] end |
#source_location ⇒ Object
27 28 29 |
# File 'lib/buildkite/test_collector/minitest_plugin/trace.rb', line 27 def source_location @source_location ||= example.method(example.name).source_location end |