Class: Highway::Runtime::Report
- Inherits:
-
Object
- Object
- Highway::Runtime::Report
- Defined in:
- lib/highway/runtime/report.rb
Overview
This class represents a report of running a step during runtime. It contains metrics (such as status and duration) as well as metadata set by steps themselves.
Instance Attribute Summary collapse
-
#data ⇒ Hash
readonly
The custom data in the report.
-
#duration ⇒ Numeric
Duration of the step, in seconds.
-
#error ⇒ FastlaneCore::Interface::FastlaneException?
An error that the step failed with, if any.
-
#invocation ⇒ Highway::Compiler::Build::Output::Invocation
The invocation.
-
#result ⇒ Symbol
Result of the step, one of: ‘:success`, `:failure`, `:skip`.
Instance Method Summary collapse
-
#[](key) ⇒ Object?
Get custom data value for given key.
-
#[]=(key, value) ⇒ Void
Set custom data value for given key.
-
#initialize(invocation:, artifacts_dir:) ⇒ Report
constructor
Initialize an instance.
-
#prepare_artifact(name) ⇒ String
Prepare an artifact file with a given name and return its path.
Constructor Details
#initialize(invocation:, artifacts_dir:) ⇒ Report
Initialize an instance.
18 19 20 21 22 |
# File 'lib/highway/runtime/report.rb', line 18 def initialize(invocation:, artifacts_dir:) @invocation = invocation @artifacts_dir = artifacts_dir @data = Hash.new() end |
Instance Attribute Details
#data ⇒ Hash (readonly)
The custom data in the report.
47 48 49 |
# File 'lib/highway/runtime/report.rb', line 47 def data @data end |
#duration ⇒ Numeric
Duration of the step, in seconds.
42 43 44 |
# File 'lib/highway/runtime/report.rb', line 42 def duration @duration end |
#error ⇒ FastlaneCore::Interface::FastlaneException?
An error that the step failed with, if any.
37 38 39 |
# File 'lib/highway/runtime/report.rb', line 37 def error @error end |
#invocation ⇒ Highway::Compiler::Build::Output::Invocation
The invocation.
27 28 29 |
# File 'lib/highway/runtime/report.rb', line 27 def invocation @invocation end |
#result ⇒ Symbol
Result of the step, one of: ‘:success`, `:failure`, `:skip`.
32 33 34 |
# File 'lib/highway/runtime/report.rb', line 32 def result @result end |
Instance Method Details
#[](key) ⇒ Object?
Get custom data value for given key.
54 55 56 |
# File 'lib/highway/runtime/report.rb', line 54 def [](key) @data[key] end |
#[]=(key, value) ⇒ Void
Set custom data value for given key.
64 65 66 |
# File 'lib/highway/runtime/report.rb', line 64 def []=(key, value) @data[key] = value end |
#prepare_artifact(name) ⇒ String
Prepare an artifact file with a given name and return its path.
73 74 75 |
# File 'lib/highway/runtime/report.rb', line 73 def prepare_artifact(name) File.join(@artifacts_dir, "#{invocation.identifier}-#{name}") end |