class Inferno::Entities::TestRun

A `TestRun` represents a request to execute an executable set of tests.

@attr_accessor [String] id of the test input @attr_accessor [String] test_session_id @attr_accessor [String] status @attr_accessor [String] test_suite_id @attr_accessor [String] test_group_id @attr_accessor [String] test_id

Constants

ATTRIBUTES
STATUS_OPTIONS

Attributes

test_session[RW]

Public Class Methods

new(params) click to toggle source

How to define test run inputs? Class in this file? Separate Entity?

Calls superclass method Inferno::Entities::Entity::new
# File lib/inferno/entities/test_run.rb, line 37
def initialize(params)
  super(params, ATTRIBUTES)

  @test_session = params[:test_session]
end

Public Instance Methods

runnable() click to toggle source
# File lib/inferno/entities/test_run.rb, line 43
def runnable
  return @runnable if @runnable

  @runnable = (test || test_group || test_suite || load_runnable)
end
test_count() click to toggle source
# File lib/inferno/entities/test_run.rb, line 53
def test_count
  @test_count ||= runnable.test_count
end
to_hash() click to toggle source
Calls superclass method Inferno::Entities::Entity#to_hash
# File lib/inferno/entities/test_run.rb, line 49
def to_hash
  super.merge(test_session: test_session).compact
end

Private Instance Methods

load_runnable() click to toggle source
# File lib/inferno/entities/test_run.rb, line 59
def load_runnable
  if test_id.present?
    @test = Inferno::Repositories::Tests.new.find(test_id)
  elsif test_group_id.present?
    @test_group = Inferno::Repositories::TestGroups.new.find(test_group_id)
  elsif test_suite_id.present?
    @test_suite = Inferno::Repositories::TestSuites.new.find(test_suite_id)
  end
end