Added test for RemoteTasks that run arbitrary commands
This commit is contained in:
parent
beae81621d
commit
3ca3f1cd24
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
workers:
|
||||
- type: ssh
|
||||
connect: localhost
|
||||
directory: /tmp
|
||||
runners: 1
|
|
@ -0,0 +1,21 @@
|
|||
require File.join(File.dirname(__FILE__), 'test_helper')
|
||||
require 'hydra/tasks'
|
||||
require 'rake'
|
||||
|
||||
class TaskTest < Test::Unit::TestCase
|
||||
context "a task" do
|
||||
should "execute the command in a remote machine" do
|
||||
|
||||
File.delete( "/tmp/new_file" ) if File.exists? "/tmp/new_file"
|
||||
|
||||
Hydra::RemoteTask.new('cat:text_file', 'touch new_file') do |t|
|
||||
t.config = "test/fixtures/task_test_config.yml"
|
||||
end
|
||||
|
||||
Rake.application['hydra:remote:cat:text_file'].invoke
|
||||
|
||||
assert( File.exists? "/tmp/new_file" )
|
||||
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue