Class: Kitchen::Terraform::SystemsVerifier::FailSlow

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/terraform/systems_verifier/fail_slow.rb

Overview

FailSlow is the class of objects which verify systems and raise rescued errors after all systems have been verified.

Instance Method Summary collapse

Constructor Details

#initialize(systems:) ⇒ Kitchen::Terraform::SystemsVerifier::FailSlow

#initialize prepares a new instance of the class.

Parameters:



29
30
31
32
# File 'lib/kitchen/terraform/systems_verifier/fail_slow.rb', line 29

def initialize(systems:)
  self.messages = []
  self.systems = systems
end

Instance Method Details

#verify(outputs:, variables:) ⇒ self

#verify verifies each system.

Parameters:

  • outputs (Hash)

    a mapping of Terraform outputs.

  • variables (Hash)

    a mapping of Terraform variables.

Returns:

  • (self)

Raises:

  • (Kitchen::TransientFailure)

    if verification of a system fails.



40
41
42
43
44
45
46
47
48
# File 'lib/kitchen/terraform/systems_verifier/fail_slow.rb', line 40

def verify(outputs:, variables:)
  systems.each do |system|
    verify_and_continue outputs: outputs, system: system, variables: variables
  end

  raise ::Kitchen::TransientFailure, messages.join("\n\n") if !messages.empty?

  self
end