Class: Retab::WorkflowTestResult

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_test_run_results/workflow_test_result.rb

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  workflow_test_run_id: :workflow_test_run_id,
  test_id: :test_id,
  lifecycle: :lifecycle,
  timing: :timing,
  verdict: :verdict,
  workflow_id: :workflow_id,
  block_id: :block_id,
  block_type: :block_type,
  execution_fingerprint: :execution_fingerprint,
  handle_inputs_fingerprint: :handle_inputs_fingerprint,
  workflow_draft_fingerprint: :workflow_draft_fingerprint,
  block_config_fingerprint: :block_config_fingerprint,
  artifact: :artifact,
  handle_inputs: :handle_inputs,
  handle_outputs: :handle_outputs,
  routing_decisions: :routing_decisions,
  warnings: :warnings,
  assertion_result: :assertion_result,
  verdict_summary: :verdict_summary
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowTestResult

Returns a new instance of WorkflowTestResult.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 54

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @id = hash[:id]
  @workflow_test_run_id = hash[:workflow_test_run_id]
  @test_id = hash[:test_id]
  @lifecycle = hash[:lifecycle] ? (
    case hash[:lifecycle][:status]
    when "cancelled"
      Retab::CancelledWorkflowTestRun.new(hash[:lifecycle])
    when "completed"
      Retab::CompletedWorkflowTestRun.new(hash[:lifecycle])
    when "error"
      Retab::ErrorWorkflowTestRun.new(hash[:lifecycle])
    when "pending"
      Retab::PendingWorkflowTestRun.new(hash[:lifecycle])
    when "queued"
      Retab::QueuedWorkflowTestRun.new(hash[:lifecycle])
    when "running"
      Retab::RunningWorkflowTestRun.new(hash[:lifecycle])
    else
      hash[:lifecycle]
    end
  ) : nil
  @timing = hash[:timing] ? Retab::WorkflowTestRunTiming.new(hash[:timing]) : nil
  @verdict = hash[:verdict]
  @workflow_id = hash[:workflow_id]
  @block_id = hash[:block_id]
  @block_type = hash[:block_type]
  @execution_fingerprint = hash[:execution_fingerprint]
  @handle_inputs_fingerprint = hash[:handle_inputs_fingerprint]
  @workflow_draft_fingerprint = hash[:workflow_draft_fingerprint]
  @block_config_fingerprint = hash[:block_config_fingerprint]
  @artifact = hash[:artifact] ? Retab::StepArtifactRef.new(hash[:artifact]) : nil
  @handle_inputs = hash[:handle_inputs] || {}
  @handle_outputs = hash[:handle_outputs] || {}
  @routing_decisions = (hash[:routing_decisions] || [])
  @warnings = (hash[:warnings] || [])
  @assertion_result = hash[:assertion_result] ? Retab::AssertionResult.new(hash[:assertion_result]) : nil
  @verdict_summary = hash[:verdict_summary] ? Retab::VerdictSummary.new(hash[:verdict_summary]) : nil
end

Instance Attribute Details

#artifactObject

Returns the value of attribute artifact.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def artifact
  @artifact
end

#assertion_resultObject

Returns the value of attribute assertion_result.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def assertion_result
  @assertion_result
end

#block_config_fingerprintObject

Returns the value of attribute block_config_fingerprint.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def block_config_fingerprint
  @block_config_fingerprint
end

#block_idObject

Returns the value of attribute block_id.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def block_id
  @block_id
end

#block_typeObject

Returns the value of attribute block_type.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def block_type
  @block_type
end

#execution_fingerprintObject

Returns the value of attribute execution_fingerprint.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def execution_fingerprint
  @execution_fingerprint
end

#handle_inputsObject

Returns the value of attribute handle_inputs.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def handle_inputs
  @handle_inputs
end

#handle_inputs_fingerprintObject

Returns the value of attribute handle_inputs_fingerprint.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def handle_inputs_fingerprint
  @handle_inputs_fingerprint
end

#handle_outputsObject

Returns the value of attribute handle_outputs.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def handle_outputs
  @handle_outputs
end

#idObject

Returns the value of attribute id.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def id
  @id
end

#lifecycleObject

Returns the value of attribute lifecycle.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def lifecycle
  @lifecycle
end

#routing_decisionsObject

Returns the value of attribute routing_decisions.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def routing_decisions
  @routing_decisions
end

#test_idObject

Returns the value of attribute test_id.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def test_id
  @test_id
end

#timingObject

Returns the value of attribute timing.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def timing
  @timing
end

#verdictObject

Returns the value of attribute verdict.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def verdict
  @verdict
end

#verdict_summaryObject

Returns the value of attribute verdict_summary.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def verdict_summary
  @verdict_summary
end

#warningsObject

Returns the value of attribute warnings.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def warnings
  @warnings
end

#workflow_draft_fingerprintObject

Returns the value of attribute workflow_draft_fingerprint.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def workflow_draft_fingerprint
  @workflow_draft_fingerprint
end

#workflow_idObject

Returns the value of attribute workflow_id.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def workflow_id
  @workflow_id
end

#workflow_test_run_idObject

Returns the value of attribute workflow_test_run_id.



31
32
33
# File 'lib/retab/workflow_test_run_results/workflow_test_result.rb', line 31

def workflow_test_run_id
  @workflow_test_run_id
end