Class: DeepTest::LocalDeployment
- Inherits:
-
Object
- Object
- DeepTest::LocalDeployment
- Defined in:
- lib/deep_test/local_deployment.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#warlock ⇒ Object
readonly
Returns the value of attribute warlock.
Instance Method Summary collapse
- #deploy_agents ⇒ Object
-
#initialize(options, agent_class = DeepTest::Agent) ⇒ LocalDeployment
constructor
A new instance of LocalDeployment.
- #load_files(files) ⇒ Object
- #number_of_agents ⇒ Object
Constructor Details
#initialize(options, agent_class = DeepTest::Agent) ⇒ LocalDeployment
Returns a new instance of LocalDeployment.
5 6 7 8 |
# File 'lib/deep_test/local_deployment.rb', line 5 def initialize(, agent_class = DeepTest::Agent) @options = @agent_class = agent_class end |
Instance Attribute Details
#warlock ⇒ Object (readonly)
Returns the value of attribute warlock.
3 4 5 |
# File 'lib/deep_test/local_deployment.rb', line 3 def warlock @warlock end |
Instance Method Details
#deploy_agents ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/deep_test/local_deployment.rb', line 18 def deploy_agents DeepTest.logger.debug { "Deploying #{number_of_agents} #{@agent_class}s" } wait_for_connect_threads = [] each_agent do |agent_num| stream_from_child_process, stream_to_parent_process = IO.pipe warlock.start "agent #{agent_num}", @agent_class.new(agent_num, @options, @options.new_listener_list), stream_from_child_process, stream_to_parent_process wait_for_connect_threads << Thread.new do stream_to_parent_process.close = stream_from_child_process.read stream_from_child_process.close raise "Agent was not able to connect: #{}" unless == "Connected\n" end end wait_for_connect_threads.each { |t| t.join } end |
#load_files(files) ⇒ Object
14 15 16 |
# File 'lib/deep_test/local_deployment.rb', line 14 def load_files(files) files.each {|f| load f} end |
#number_of_agents ⇒ Object
36 37 38 |
# File 'lib/deep_test/local_deployment.rb', line 36 def number_of_agents @options.number_of_agents end |