BigW Consortium Gitlab

system_check.rb 739 Bytes
Newer Older
1 2 3 4 5 6
# Library to perform System Checks
#
# Every Check is implemented as its own class inherited from SystemCheck::BaseCheck
# Execution coordination and boilerplate output is done by the SystemCheck::SimpleExecutor
#
# This structure decouples checks from Rake tasks and facilitates unit-testing
7
module SystemCheck
8 9 10 11
  # Executes a bunch of checks for specified component
  #
  # @param [String] component name of the component relative to the checks being executed
  # @param [Array<BaseCheck>] checks classes of corresponding checks to be executed in the same order
12 13
  def self.run(component, checks = [])
    executor = SimpleExecutor.new(component)
14

15 16
    checks.each do |check|
      executor << check
17
    end
18

19
    executor.execute
20 21
  end
end