Class: Inferno::Entities::Result
- Includes:
- HasRunnable
- Defined in:
- lib/inferno/entities/result.rb
Overview
A Result
represents the result of running a Test
, TestGroup
,
or TestSuite
Constant Summary collapse
- ATTRIBUTES =
[ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze
- RESULT_OPTIONS =
['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze
Instance Attribute Summary collapse
-
#created_at ⇒ Time
Creation timestamp.
-
#id ⇒ String
Id of the session.
-
#input_json ⇒ String
JSON string of the inputs used for this result.
-
#messages ⇒ Array<Inferno::Entities::Message>
result.
-
#output_json ⇒ String
JSON string of the outputs created by this result.
-
#requests ⇒ Array<Inferno::Entities::Request>
associated with this result.
-
#result ⇒ String
running
,wait
,cancel
). -
#result_message ⇒ String
Summary message for this result.
-
#test ⇒ Test?
The
Test
this result belongs to. -
#test_group ⇒ TestGroup?
The
TestGroup
this result belongs to. -
#test_group_id ⇒ String?
Id of the
TestGroup
this result belongs to. -
#test_id ⇒ String?
Id of the
Test
this result belongs to. -
#test_run_id ⇒ String
The
TestRun
this result belongs to. -
#test_session_id ⇒ String
The
TestSession
this result belongs to. -
#test_suite ⇒ TestSuite?
The
TestSuite
this result belongs to. -
#test_suite_id ⇒ String?
Id of the
TestSuite
this result belongs to. -
#updated_at ⇒ Time
Update timestamp.
Instance Method Summary collapse
-
#initialize(params) ⇒ Result
constructor
A new instance of Result.
-
#optional? ⇒ Boolean
-
#required? ⇒ Boolean
-
#waiting? ⇒ Boolean
Methods included from HasRunnable
Methods inherited from Entity
Constructor Details
#initialize(params) ⇒ Result
Returns a new instance of Result.
55 56 57 58 59 60 |
# File 'lib/inferno/entities/result.rb', line 55 def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end |
Instance Attribute Details
#created_at ⇒ Time
Returns creation timestamp.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#id ⇒ String
Returns id of the session.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#input_json ⇒ String
Returns JSON string of the inputs used for this result.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#messages ⇒ Array<Inferno::Entities::Message>
result
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#output_json ⇒ String
Returns JSON string of the outputs created by this result.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#requests ⇒ Array<Inferno::Entities::Request>
associated with this result
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#result ⇒ String
running
, wait
, cancel
)
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#result_message ⇒ String
Returns summary message for this result.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#test ⇒ Test?
Returns the Test
this result belongs to.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#test_group ⇒ TestGroup?
Returns the TestGroup
this result belongs to.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#test_group_id ⇒ String?
Returns id of the TestGroup
this result belongs to.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#test_id ⇒ String?
Returns id of the Test
this result belongs to.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#test_run_id ⇒ String
Returns the TestRun
this result belongs to.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#test_session_id ⇒ String
Returns the TestSession
this result belongs to.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#test_suite ⇒ TestSuite?
Returns the TestSuite
this result belongs to.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#test_suite_id ⇒ String?
Returns id of the TestSuite
this result belongs to.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
#updated_at ⇒ Time
Returns update timestamp.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/inferno/entities/result.rb', line 43 class Result < Entity ATTRIBUTES = [ :id, :created_at, :updated_at, :test_id, :test, :test_group_id, :test_group, :test_suite_id, :test_suite, :test_run_id, :test_session_id, :result, :result_message, :messages, :requests, :input_json, :output_json ].freeze RESULT_OPTIONS = ['cancel', 'wait', 'running', 'error', 'fail', 'skip', 'pass', 'omit'].freeze include Inferno::Entities::Attributes include Inferno::Entities::HasRunnable def initialize(params) super(params, ATTRIBUTES - [:messages, :requests]) @messages = (params[:messages] || []).map { || Message.new() } @requests = (params[:requests] || []).map { |request| Request.new(request) } end def optional? runnable.nil? || runnable.optional? end def required? !optional? end # @return [Boolean] def waiting? result == 'wait' end end |
Instance Method Details
#optional? ⇒ Boolean
62 63 64 |
# File 'lib/inferno/entities/result.rb', line 62 def optional? runnable.nil? || runnable.optional? end |
#required? ⇒ Boolean
66 67 68 |
# File 'lib/inferno/entities/result.rb', line 66 def required? !optional? end |
#waiting? ⇒ Boolean
71 72 73 |
# File 'lib/inferno/entities/result.rb', line 71 def waiting? result == 'wait' end |