Class: Henitai::Configuration
- Inherits:
-
Object
- Object
- Henitai::Configuration
- Defined in:
- lib/henitai/configuration.rb
Overview
Loads and validates .henitai.yml configuration.
Configuration is resolved from built-in defaults and the project-root ‘.henitai.yml` file.
Constant Summary collapse
- DEFAULT_TIMEOUT =
10.0- DEFAULT_OPERATORS =
:light- DEFAULT_JOBS =
1- DEFAULT_MAX_FLAKY_RETRIES =
3- DEFAULT_REPORTS_DIR =
"reports"- DEFAULT_COVERAGE_CRITERIA =
{ test_result: true, timeout: false, process_abort: false }.freeze
- DEFAULT_THRESHOLDS =
{ high: 80, low: 60 }.freeze
- CONFIG_FILE =
".henitai.yml"
Instance Attribute Summary collapse
-
#all_logs ⇒ Object
readonly
Returns the value of attribute all_logs.
-
#coverage_criteria ⇒ Object
readonly
Returns the value of attribute coverage_criteria.
-
#dashboard ⇒ Object
readonly
Returns the value of attribute dashboard.
-
#ignore_patterns ⇒ Object
readonly
Returns the value of attribute ignore_patterns.
-
#includes ⇒ Object
readonly
Returns the value of attribute includes.
-
#integration ⇒ Object
readonly
Returns the value of attribute integration.
-
#jobs ⇒ Object
readonly
Returns the value of attribute jobs.
-
#max_flaky_retries ⇒ Object
readonly
Returns the value of attribute max_flaky_retries.
-
#operators ⇒ Object
readonly
Returns the value of attribute operators.
-
#reporters ⇒ Object
readonly
Returns the value of attribute reporters.
-
#reports_dir ⇒ Object
readonly
Returns the value of attribute reports_dir.
-
#sampling ⇒ Object
readonly
Returns the value of attribute sampling.
-
#thresholds ⇒ Object
readonly
Returns the value of attribute thresholds.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path: CONFIG_FILE, overrides: {}) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(path: CONFIG_FILE, overrides: {}) ⇒ Configuration
Returns a new instance of Configuration.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/henitai/configuration.rb', line 37 def initialize(path: CONFIG_FILE, overrides: {}) raw = load_raw_configuration(path) unless raw.is_a?(Hash) raise Henitai::ConfigurationError, "Invalid configuration value for configuration: expected Hash, got #{raw.class}" end merged = merge_defaults(raw, symbolize_keys(overrides)) ConfigurationValidator.validate!(merged) apply_defaults(merged) end |
Instance Attribute Details
#all_logs ⇒ Object (readonly)
Returns the value of attribute all_logs.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def all_logs @all_logs end |
#coverage_criteria ⇒ Object (readonly)
Returns the value of attribute coverage_criteria.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def coverage_criteria @coverage_criteria end |
#dashboard ⇒ Object (readonly)
Returns the value of attribute dashboard.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def dashboard @dashboard end |
#ignore_patterns ⇒ Object (readonly)
Returns the value of attribute ignore_patterns.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def ignore_patterns @ignore_patterns end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def includes @includes end |
#integration ⇒ Object (readonly)
Returns the value of attribute integration.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def integration @integration end |
#jobs ⇒ Object (readonly)
Returns the value of attribute jobs.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def jobs @jobs end |
#max_flaky_retries ⇒ Object (readonly)
Returns the value of attribute max_flaky_retries.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def max_flaky_retries @max_flaky_retries end |
#operators ⇒ Object (readonly)
Returns the value of attribute operators.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def operators @operators end |
#reporters ⇒ Object (readonly)
Returns the value of attribute reporters.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def reporters @reporters end |
#reports_dir ⇒ Object (readonly)
Returns the value of attribute reports_dir.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def reports_dir @reports_dir end |
#sampling ⇒ Object (readonly)
Returns the value of attribute sampling.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def sampling @sampling end |
#thresholds ⇒ Object (readonly)
Returns the value of attribute thresholds.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def thresholds @thresholds end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
26 27 28 |
# File 'lib/henitai/configuration.rb', line 26 def timeout @timeout end |
Class Method Details
.load(path: CONFIG_FILE, overrides: {}) ⇒ Object
33 34 35 |
# File 'lib/henitai/configuration.rb', line 33 def self.load(path: CONFIG_FILE, overrides: {}) new(path:, overrides:) end |