even more test fixes, this almost works...
This commit is contained in:
parent
236de8be1a
commit
3f75c9fb76
|
@ -40,6 +40,7 @@ module Hydra #:nodoc:
|
|||
for sign in [:SIGHUP, :INT]
|
||||
trap sign do
|
||||
stop
|
||||
exit if @event_listeners.empty?
|
||||
end
|
||||
end
|
||||
@runner_began = true
|
||||
|
|
|
@ -28,11 +28,5 @@ module Hydra #:nodoc:
|
|||
def initialize(connection_options, directory, command)
|
||||
@writer, @reader, @error = popen3(%{ssh -tt #{connection_options} 'mkdir -p #{directory} && cd #{directory} && #{command}'})
|
||||
end
|
||||
|
||||
# Close the SSH connection
|
||||
def close
|
||||
@writer.write "exit\n"
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'rspec'
|
||||
require 'hydra/tmpdir'
|
||||
context "file writing" do
|
||||
describe "file writing" do
|
||||
it "writes to a file" do
|
||||
File.open(File.join(Dir.consistent_tmpdir, 'alternate_hydra_test.txt'), 'a') do |f|
|
||||
f.write "HYDRA"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'rspec'
|
||||
require 'hydra/tmpdir'
|
||||
context "file writing" do
|
||||
describe "file writing" do
|
||||
it "writes to a file" do
|
||||
File.open(File.join(Dir.consistent_tmpdir, 'hydra_test.txt'), 'a') do |f|
|
||||
f.write "HYDRA"
|
||||
|
|
|
@ -100,7 +100,7 @@ class RunnerTest < Test::Unit::TestCase
|
|||
|
||||
should "be able to run a runner over ssh" do
|
||||
ssh = Hydra::SSH.new(
|
||||
'localhost',
|
||||
'localhost -o ControlMaster=no',
|
||||
File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')),
|
||||
%{ruby -rrubygems -e "require \\"bundler/setup\\"; require \\"hydra\\"; Hydra::Runner.new(:options => {}, :io => Hydra::Stdio.new, :verbose => true);"}
|
||||
)
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'test_helper'
|
|||
class SSHTest < Test::Unit::TestCase
|
||||
should "be able to execute a command over ssh" do
|
||||
ssh = Hydra::SSH.new(
|
||||
'localhost', # connect to this machine
|
||||
'localhost -o ControlMaster=no', # connect to this machine
|
||||
File.expand_path(File.join(File.dirname(__FILE__))), # move to the test directory
|
||||
"ruby fixtures/hello_world.rb"
|
||||
)
|
||||
|
@ -14,7 +14,7 @@ class SSHTest < Test::Unit::TestCase
|
|||
|
||||
should "be able to handle a large number of non-Hydra console output" do
|
||||
ssh = Hydra::SSH.new(
|
||||
'localhost', # connect to this machine
|
||||
'localhost -o ControlMaster=no', # connect to this machine
|
||||
File.expand_path(File.join(File.dirname(__FILE__))), # move to the test directory
|
||||
"ruby fixtures/many_outputs_to_console.rb"
|
||||
)
|
||||
|
@ -23,3 +23,4 @@ class SSHTest < Test::Unit::TestCase
|
|||
ssh.close
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class WorkerTest < Test::Unit::TestCase
|
|||
module WorkerTestHelper
|
||||
def run_the_worker(pipe, num_runners)
|
||||
pipe.identify_as_child
|
||||
Hydra::Worker.new({:io => pipe, :runners => num_runners})
|
||||
Hydra::Worker.new({:io => pipe, :runners => num_runners, :options => {}})
|
||||
end
|
||||
|
||||
def request_a_file_and_verify_completion(pipe, num_runners)
|
||||
|
|
Loading…
Reference in New Issue