Module: Henitai::ConfigurationValidator

Defined in:
lib/henitai/configuration_validator.rb,
lib/henitai/configuration_validator/rules.rb,
lib/henitai/configuration_validator/scalars.rb,
sig/configuration_validator.rbs

Overview

Internal validator for configuration data loaded from YAML and CLI overrides.

The public entry point is ConfigurationValidator.validate!; the individual rules live in Rules. Unknown-key warnings are emitted via ConfigurationValidator.warn so that callers (and specs) can observe them on this module.

Defined Under Namespace

Modules: Rules, Scalars

Constant Summary collapse

VALID_TOP_LEVEL_KEYS =

Returns:

  • (Array[Symbol])
%i[
  integration
  includes
  excludes
  test_excludes
  mutation
  coverage_criteria
  thresholds
  reporters
  reports_dir
  reports
  all_logs
  dashboard
  jobs
].freeze
VALID_MUTATION_KEYS =

Returns:

  • (Array[Symbol])
%i[
  operators timeout timeout_multiplier ignore_patterns max_flaky_retries max_log_bytes max_timeout sampling
].freeze
VALID_REPORTS_KEYS =
%i[checkpoint checkpoint_every checkpoint_interval].freeze
VALID_SAMPLING_KEYS =

Returns:

  • (Array[Symbol])
%i[ratio strategy].freeze
VALID_COVERAGE_CRITERIA_KEYS =

Returns:

  • (Array[Symbol])
%i[test_result timeout process_abort].freeze
VALID_THRESHOLDS_KEYS =

Returns:

  • (Array[Symbol])
%i[high low].freeze
VALID_DASHBOARD_KEYS =

Returns:

  • (Array[Symbol])
%i[project base_url].freeze
VALID_INTEGRATION_KEYS =

Returns:

  • (Array[Symbol])
%i[name].freeze
VALID_OPERATORS =

Returns:

  • (Array[Symbol])
%i[light full hard].freeze
VALIDATION_STEPS =

Returns:

  • (Array[Symbol])
%i[
  validate_top_level_keys
  validate_integration
  validate_includes
  validate_excludes
  validate_test_excludes
  validate_jobs
  validate_reporters
  validate_reports_dir
  validate_reports
  validate_all_logs
  validate_dashboard
  validate_mutation
  validate_coverage_criteria
  validate_thresholds
].freeze

Class Method Summary collapse

Class Method Details

.validate!(raw) ⇒ void

This method returns an undefined value.

Parameters:

  • (Hash[Symbol, untyped])


54
55
56
57
# File 'lib/henitai/configuration_validator.rb', line 54

def self.validate!(raw)
  Rules.ensure_hash!(raw, "configuration")
  VALIDATION_STEPS.each { |step| Rules.public_send(step, raw) }
end

.warn(message) ⇒ void

This method returns an undefined value.

Parameters:

  • (String)


59
60
61
# File 'lib/henitai/configuration_validator.rb', line 59

def self.warn(message)
  Kernel.warn(message)
end