class Highway::Runtime::Report

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.

Attributes

data[R]

The custom data in the report.

@return [Hash]

duration[RW]

Duration of the step, in seconds.

@return [Numeric]

error[RW]

An error that the step failed with, if any.

@return [FastlaneCore::Interface::FastlaneException, nil]

invocation[RW]

The invocation.

@return [Highway::Compiler::Build::Output::Invocation]

result[RW]

Result of the step, one of: `:success`, `:failure`, `:skip`.

@return [Symbol]

Public Class Methods

new(invocation:, artifacts_dir:) click to toggle source

Initialize an instance.

@param invocation [Highway::Compiler::Build::Output::Invocation] The invocation. @param artifacts_dir [Path] Dir in which to prepare artifacts.

# File lib/highway/runtime/report.rb, line 18
def initialize(invocation:, artifacts_dir:)
  @invocation = invocation
  @artifacts_dir = artifacts_dir
  @data = Hash.new()
end

Public Instance Methods

[](key) click to toggle source

Get custom data value for given key.

@param key [String] A key.

@return [Object, nil]

# File lib/highway/runtime/report.rb, line 54
def [](key)
  @data[key]
end
[]=(key, value) click to toggle source

Set custom data value for given key.

@param key [String] A key. @param value [Object, nil] A value.

@return [Void]

# File lib/highway/runtime/report.rb, line 64
def []=(key, value)
  @data[key] = value
end
prepare_artifact(name) click to toggle source

Prepare an artifact file with a given name and return its path.

@param name [String] An artifact file name.

@return [String]

# File lib/highway/runtime/report.rb, line 73
def prepare_artifact(name)
  File.join(@artifacts_dir, "#{invocation.identifier}-#{name}")
end