# File lib/deep_test/distributed/test_server.rb, line 72 def self.connect(options) servers = DRbObject.new_with_uri(options.distributed_server).servers MultiTestServerProxy.new(options, servers) end
# File lib/deep_test/distributed/test_server.rb, line 10 def initialize(config) @config = config end
# File lib/deep_test/distributed/test_server.rb, line 47 def self.parse_args(args) options = DeepTest::Distributed::TestServer::DEFAULT_CONFIG.dup OptionParser.new do |opts| opts.banner = "Usage: deep_test test_server [options]" opts.on("--work_dir PATH", "Absolute path to keep mirror working copies at") do |v| options[:work_dir] = v end opts.on("--uri URI", "DRb URI to bind server to") do |v| options[:uri] = v end opts.on("--number_of_workers NUM", "Number of workers to start when running tests") do |v| options[:number_of_workers] = v.to_i end opts.on_tail("-h", "--help", "Show this message") do puts opts exit end end.parse(args) options end
# File lib/deep_test/distributed/test_server.rb, line 36 def servers [DRbObject.new_with_uri(DRb.uri)] end
# File lib/deep_test/distributed/test_server.rb, line 14 def spawn_worker_server(options) DeepTest.logger.debug("mirror spawn_worker_server for #{options.origin_hostname}") RemoteWorkerServer.start(URI.parse(@config[:uri]).host, options.mirror_path(@config[:work_dir]), TestServerWorkers.new(options, @config, DRbClientConnectionInfo.new)) end
# File lib/deep_test/distributed/test_server.rb, line 21 def status TestServerStatus.new( DRb.uri, @config[:number_of_workers], RemoteWorkerServer.running_server_count ) end
# File lib/deep_test/distributed/test_server.rb, line 29 def sync(options) DeepTest.logger.debug "mirror sync for #{options.origin_hostname}" path = options.mirror_path(@config[:work_dir]) DeepTest.logger.debug "Syncing #{options.sync_options[:source]} to #{path}" RSync.sync(DRbClientConnectionInfo.new, options, path) end
Generated with the Darkfish Rdoc Generator 2.