Class: Profiler::TestRunner::RunStore::Run

Inherits:
Struct
  • Object
show all
Defined in:
lib/profiler/test_runner/run_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exit_codeObject

Returns the value of attribute exit_code

Returns:

  • (Object)

    the current value of exit_code



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def exit_code
  @exit_code
end

#filesObject

Returns the value of attribute files

Returns:

  • (Object)

    the current value of files



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def files
  @files
end

#finished_atObject

Returns the value of attribute finished_at

Returns:

  • (Object)

    the current value of finished_at



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def finished_at
  @finished_at
end

#frameworkObject

Returns the value of attribute framework

Returns:

  • (Object)

    the current value of framework



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def framework
  @framework
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def id
  @id
end

#output_linesObject

Returns the value of attribute output_lines

Returns:

  • (Object)

    the current value of output_lines



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def output_lines
  @output_lines
end

#pidObject

Returns the value of attribute pid

Returns:

  • (Object)

    the current value of pid



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def pid
  @pid
end

#started_atObject

Returns the value of attribute started_at

Returns:

  • (Object)

    the current value of started_at



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def started_at
  @started_at
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



11
12
13
# File 'lib/profiler/test_runner/run_store.rb', line 11

def status
  @status
end

Instance Method Details

#to_hObject



12
13
14
15
16
17
18
19
# File 'lib/profiler/test_runner/run_store.rb', line 12

def to_h
  super.merge(
    started_at: started_at&.iso8601,
    finished_at: finished_at&.iso8601,
    output: output_lines.join,
    duration: finished_at && started_at ? ((finished_at - started_at) * 1000).round(2) : nil
  ).except(:output_lines)
end