Module: ConfigurationService::Test::OrchestratorEnvironmentFactory
- Defined in:
- lib/configuration_service/test/orchestrator_environment_factory.rb
Overview
A factory for building a test orchestrator using an orchestration provider selected from the environment
Class Method Summary collapse
-
.build ⇒ ConfigurationService::Test::Orchestrator
Build a test orchestrator.
Class Method Details
.build ⇒ ConfigurationService::Test::Orchestrator
Build a test orchestrator
Looks up the test orchestration provider class registered to the ConfigurationService::Test::OrchestrationProviderRegistry with the name provided in the TEST_ORCHESTRATION_PROVIDER
environment variable, and returns a new ConfigurationService::Test::Orchestrator initialized with an instance of that provider class.
33 34 35 36 37 38 |
# File 'lib/configuration_service/test/orchestrator_environment_factory.rb', line 33 def self.build identifier = ENV["TEST_ORCHESTRATION_PROVIDER"] or raise "missing environment variable: TEST_ORCHESTRATION_PROVIDER" registry = ConfigurationService::Test::OrchestrationProviderRegistry.instance provider = registry.lookup(identifier) or raise "unknown test orchestration provider: #{identifier}" ConfigurationService::Test::Orchestrator.new(provider) end |