Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
79 additions
and
49 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ source 'http://rubygems.org' | |
gem 'pry' | ||
gem 'jeweler2' | ||
gem 'iron_worker_ng' | ||
gem 'test-unit' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'iron_worker_ng' | ||
|
||
p params | ||
|
||
puts "ENV" | ||
p ENV | ||
|
||
puts "pwd: " + `pwd` | ||
puts `ls -al` | ||
|
||
puts `go build hello.go` | ||
|
||
puts `ls -al` | ||
|
||
# todo: remove this next line, just for testing | ||
puts `./hello` | ||
|
||
puts "Uploading code..." | ||
@client = IronWorkerNG::Client.new(params) | ||
code = IronWorkerNG::Code::Binary.new() | ||
code.name = params['name'] | ||
code.merge_exec "hello" | ||
p @client.codes_create(code) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
gem 'test-unit' | ||
require 'test/unit' | ||
require_relative 'helpers' | ||
|
||
class BasicTest < IWNGTest | ||
def test_build_worker | ||
code = IronWorkerNG::Code::Ruby.new('build_worker.rb') | ||
code.merge_gem 'iron_worker_ng' | ||
code.merge_file 'workers/hello.go' | ||
code.merge_file 'workers/hello_go.worker' | ||
#code.merge_exec(File.dirname(__FILE__) + '/hello.rb') | ||
client.codes_create(code) | ||
task_id = client.tasks.create('BuildWorker', | ||
client.api.options.merge(:name => "HelloGo")).id | ||
|
||
task = client.tasks_wait_for(task_id) | ||
assert task | ||
assert task.id == task_id | ||
assert_equal "complete", task.status | ||
|
||
log = client.tasks_log(task_id) | ||
puts "LOG START" | ||
puts log | ||
puts "LOG END" | ||
|
||
puts 'Running HelloGo...' | ||
go_task_id = client.tasks.create("HelloGo").id | ||
task = client.tasks_wait_for(go_task_id) | ||
assert_equal "complete", task.status | ||
log = client.tasks_log(go_task_id) | ||
puts "LOG START" | ||
puts log | ||
puts "LOG END" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
func main() { | ||
fmt.Println("Hello Gophers!") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
runtime 'go' | ||
exec 'hello.go' |