Sha256: 3045af3537f6db5af3042590bcacfe701f06e0297c22ec2de2c7407309373576
Contents?: true
Size: 1.71 KB
Versions: 12
Compression:
Stored size: 1.71 KB
Contents
Inferno::Application.register_provider(:suites) do prepare do target_container.start :logging require 'inferno/entities/test' require 'inferno/entities/test_group' require 'inferno/entities/test_suite' require 'inferno/entities/test_kit' files_to_load = Dir.glob(File.join(Dir.pwd, 'lib', '*.rb')) if ENV['LOAD_DEV_SUITES'].present? ENV['LOAD_DEV_SUITES'].split(',').map(&:strip).reject(&:empty?).each do |suite| files_to_load.concat Dir.glob(File.join(Inferno::Application.root, 'dev_suites', suite, '**', '*.rb')) end end if ENV['APP_ENV'] == 'test' files_to_load.concat Dir.glob(File.join(Inferno::Application.root, 'spec', 'fixtures', '**', '*.rb')) end # Whenever the definition of a Runnable class ends, add it to the # appropriate repository. in_memory_entities_trace = TracePoint.trace(:end) do |trace| if trace.self < Inferno::Entities::Test || trace.self < Inferno::Entities::TestGroup || trace.self < Inferno::Entities::TestSuite || trace.self < Inferno::Entities::TestKit trace.self.add_self_to_repository end end files_to_load.map! { |path| File.realpath(path) } files_to_load.each do |path| require_relative path end in_memory_entities_trace.disable Inferno::Entities::TestSuite.descendants.each do |descendant| # When ID not assigned in custom test suites, Runnable.id will return default ID # equal to the custom test suite's parent class name if descendant.id.blank? || descendant.id == 'Inferno::Entities::TestSuite' raise StandardError, "Error initializing test suite #{descendant.name}: test suite ID is not set" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems