Class: Ace::Test::EndToEndRunner::Molecules::ConfigLoader
- Inherits:
-
Object
- Object
- Ace::Test::EndToEndRunner::Molecules::ConfigLoader
- Defined in:
- lib/ace/test/end_to_end_runner/molecules/config_loader.rb
Overview
Load configuration using Ace::Support::Config.create() API Follows ADR-022: Configuration Default and Override Pattern
Configuration priority (highest to lowest):
-
CLI options (handled by callers)
-
Project config: .ace/e2e-runner/config.yml
-
Gem defaults: ace-test-runner-e2e/.ace-defaults/e2e-runner/config.yml
Class Method Summary collapse
-
.cli_args_for(provider_name) ⇒ String?
Required CLI args for provider.
-
.cli_providers ⇒ Array<String>
CLI provider names.
-
.default_parallel ⇒ Integer
Default parallel count from config.
-
.default_provider ⇒ String
Default provider from config.
-
.default_runner_provider ⇒ String
Default runner provider from config.
-
.default_sandbox_profile ⇒ String
Default sandbox bootstrap profile.
-
.default_sandbox_ruby_version ⇒ String
Dedicated Ruby version for sandbox runtime.
-
.default_timeout ⇒ Integer
Default timeout from config.
-
.default_verifier_provider ⇒ String
Default verifier provider from config.
-
.load ⇒ Hash
Load and return merged config hash.
Instance Method Summary collapse
-
#load ⇒ Hash
Load merged config from cascade.
Class Method Details
.cli_args_for(provider_name) ⇒ String?
Returns Required CLI args for provider.
76 77 78 79 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 76 def self.cli_args_for(provider_name) config = load config.dig("providers", "cli_args", provider_name) end |
.cli_providers ⇒ Array<String>
Returns CLI provider names.
69 70 71 72 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 69 def self.cli_providers config = load config.dig("providers", "cli") || %w[claude gemini codex codexoss opencode pi] end |
.default_parallel ⇒ Integer
Returns Default parallel count from config.
51 52 53 54 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 51 def self.default_parallel config = load config.dig("execution", "parallel") || 3 end |
.default_provider ⇒ String
Returns Default provider from config.
24 25 26 27 28 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 24 def self.default_provider config = load config.dig("execution", "runner_provider") || config.dig("execution", "provider") || "claude:sonnet" end |
.default_runner_provider ⇒ String
Returns Default runner provider from config.
31 32 33 34 35 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 31 def self.default_runner_provider config = load config.dig("execution", "runner_provider") || config.dig("execution", "provider") || "claude:sonnet" end |
.default_sandbox_profile ⇒ String
Returns Default sandbox bootstrap profile.
57 58 59 60 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 57 def self.default_sandbox_profile config = load config.dig("sandbox", "profile") || "ace-default" end |
.default_sandbox_ruby_version ⇒ String
Returns Dedicated Ruby version for sandbox runtime.
63 64 65 66 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 63 def self.default_sandbox_ruby_version config = load config.dig("sandbox", "ruby_version") || "3.4.9" end |
.default_timeout ⇒ Integer
Returns Default timeout from config.
45 46 47 48 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 45 def self.default_timeout config = load config.dig("execution", "timeout") || 300 end |
.default_verifier_provider ⇒ String
Returns Default verifier provider from config.
38 39 40 41 42 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 38 def self.default_verifier_provider config = load config.dig("execution", "verifier_provider") || config.dig("execution", "provider") || "claude:sonnet" end |
.load ⇒ Hash
Load and return merged config hash
19 20 21 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 19 def self.load new.load end |
Instance Method Details
#load ⇒ Hash
Load merged config from cascade
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/ace/test/end_to_end_runner/molecules/config_loader.rb', line 83 def load gem_root = Gem.loaded_specs["ace-test-runner-e2e"]&.gem_dir || File.("../../../../..", __dir__) resolver = Ace::Support::Config.create( config_dir: ".ace", defaults_dir: ".ace-defaults", gem_path: gem_root ) resolver.resolve_namespace("e2e-runner").data rescue => e warn "Warning: Could not load e2e-runner config: #{e.}" if ENV["DEBUG"] {} end |