neptune 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +4 -0
- data/doc/BabelHelper.html +393 -376
- data/doc/BadConfigurationException.html +121 -127
- data/doc/CommonFunctions.html +237 -265
- data/doc/ExodusHelper.html +820 -0
- data/doc/ExodusTaskInfo.html +263 -0
- data/doc/FileNotFoundException.html +121 -127
- data/doc/NeptuneHelper.html +527 -592
- data/doc/NeptuneManagerClient.html +696 -0
- data/doc/NeptuneManagerException.html +139 -0
- data/doc/Object.html +334 -236
- data/doc/TaskInfo.html +428 -0
- data/doc/created.rid +8 -5
- data/doc/images/add.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/index.html +74 -142
- data/doc/js/darkfish.js +99 -62
- data/doc/js/jquery.js +15 -29
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/table_of_contents.html +226 -0
- data/lib/babel.rb +116 -50
- data/lib/custom_exceptions.rb +2 -2
- data/lib/exodus.rb +311 -0
- data/lib/exodus_task_info.rb +36 -0
- data/lib/neptune.rb +52 -18
- data/lib/{app_controller_client.rb → neptune_manager_client.rb} +54 -38
- data/lib/task_info.rb +155 -0
- data/test/{unit/test_babel.rb → test_babel.rb} +161 -26
- data/test/{unit/test_common_functions.rb → test_common_functions.rb} +1 -1
- data/test/test_exodus.rb +687 -0
- data/test/{unit/test_neptune.rb → test_neptune.rb} +28 -17
- data/test/{unit/test_app_controller_client.rb → test_neptune_manager_client.rb} +15 -16
- data/test/test_task_info.rb +32 -0
- data/test/{unit/ts_all.rb → ts_all.rb} +3 -1
- metadata +30 -34
- data/doc/AppControllerClient.html +0 -702
- data/doc/AppControllerException.html +0 -145
- data/doc/bin/neptune.html +0 -56
- data/doc/js/quicksearch.js +0 -114
- data/doc/js/thickbox-compressed.js +0 -10
- data/doc/lib/app_controller_client_rb.html +0 -60
- data/doc/lib/babel_rb.html +0 -68
- data/doc/lib/common_functions_rb.html +0 -70
- data/doc/lib/custom_exceptions_rb.html +0 -54
- data/doc/lib/neptune_rb.html +0 -60
- data/test/integration/tc_c.rb +0 -57
- data/test/integration/tc_dfsp.rb +0 -37
- data/test/integration/tc_dwssa.rb +0 -38
- data/test/integration/tc_erlang.rb +0 -183
- data/test/integration/tc_mapreduce.rb +0 -282
- data/test/integration/tc_mpi.rb +0 -160
- data/test/integration/tc_storage.rb +0 -209
- data/test/integration/tc_upc.rb +0 -75
- data/test/integration/tc_x10.rb +0 -94
- data/test/integration/test_helper.rb +0 -135
- data/test/integration/ts_neptune.rb +0 -40
@@ -1,70 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
-
<head>
|
7
|
-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
|
-
|
9
|
-
<title>File: common_functions.rb [RDoc Documentation]</title>
|
10
|
-
|
11
|
-
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
|
12
|
-
|
13
|
-
<script src="../js/jquery.js" type="text/javascript"
|
14
|
-
charset="utf-8"></script>
|
15
|
-
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
16
|
-
charset="utf-8"></script>
|
17
|
-
<script src="../js/quicksearch.js" type="text/javascript"
|
18
|
-
charset="utf-8"></script>
|
19
|
-
<script src="../js/darkfish.js" type="text/javascript"
|
20
|
-
charset="utf-8"></script>
|
21
|
-
</head>
|
22
|
-
|
23
|
-
<body class="file file-popup">
|
24
|
-
<div id="metadata">
|
25
|
-
<dl>
|
26
|
-
<dt class="modified-date">Last Modified</dt>
|
27
|
-
<dd class="modified-date">Sun Feb 12 16:18:14 -0800 2012</dd>
|
28
|
-
|
29
|
-
|
30
|
-
<dt class="requires">Requires</dt>
|
31
|
-
<dd class="requires">
|
32
|
-
<ul>
|
33
|
-
|
34
|
-
<li>digest/sha1</li>
|
35
|
-
|
36
|
-
<li>fileutils</li>
|
37
|
-
|
38
|
-
<li>net/http</li>
|
39
|
-
|
40
|
-
<li>openssl</li>
|
41
|
-
|
42
|
-
<li>socket</li>
|
43
|
-
|
44
|
-
<li>timeout</li>
|
45
|
-
|
46
|
-
<li>yaml</li>
|
47
|
-
|
48
|
-
<li>custom_exceptions</li>
|
49
|
-
|
50
|
-
</ul>
|
51
|
-
</dd>
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
</dl>
|
56
|
-
</div>
|
57
|
-
|
58
|
-
<div id="documentation">
|
59
|
-
|
60
|
-
<div class="description">
|
61
|
-
<h2>Description</h2>
|
62
|
-
|
63
|
-
<p>Programmer: Chris Bunch (cgb@cs.ucsb.edu)</p>
|
64
|
-
|
65
|
-
</div>
|
66
|
-
|
67
|
-
</div>
|
68
|
-
</body>
|
69
|
-
</html>
|
70
|
-
|
@@ -1,54 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
-
<head>
|
7
|
-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
|
-
|
9
|
-
<title>File: custom_exceptions.rb [RDoc Documentation]</title>
|
10
|
-
|
11
|
-
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
|
12
|
-
|
13
|
-
<script src="../js/jquery.js" type="text/javascript"
|
14
|
-
charset="utf-8"></script>
|
15
|
-
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
16
|
-
charset="utf-8"></script>
|
17
|
-
<script src="../js/quicksearch.js" type="text/javascript"
|
18
|
-
charset="utf-8"></script>
|
19
|
-
<script src="../js/darkfish.js" type="text/javascript"
|
20
|
-
charset="utf-8"></script>
|
21
|
-
</head>
|
22
|
-
|
23
|
-
<body class="file file-popup">
|
24
|
-
<div id="metadata">
|
25
|
-
<dl>
|
26
|
-
<dt class="modified-date">Last Modified</dt>
|
27
|
-
<dd class="modified-date">Sun Feb 12 16:18:29 -0800 2012</dd>
|
28
|
-
|
29
|
-
|
30
|
-
<dt class="requires">Requires</dt>
|
31
|
-
<dd class="requires">
|
32
|
-
<ul>
|
33
|
-
|
34
|
-
</ul>
|
35
|
-
</dd>
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
</dl>
|
40
|
-
</div>
|
41
|
-
|
42
|
-
<div id="documentation">
|
43
|
-
|
44
|
-
<div class="description">
|
45
|
-
<h2>Description</h2>
|
46
|
-
|
47
|
-
<p>Programmer: Chris Bunch</p>
|
48
|
-
|
49
|
-
</div>
|
50
|
-
|
51
|
-
</div>
|
52
|
-
</body>
|
53
|
-
</html>
|
54
|
-
|
data/doc/lib/neptune_rb.html
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
|
5
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
-
<head>
|
7
|
-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
|
-
|
9
|
-
<title>File: neptune.rb [RDoc Documentation]</title>
|
10
|
-
|
11
|
-
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
|
12
|
-
|
13
|
-
<script src="../js/jquery.js" type="text/javascript"
|
14
|
-
charset="utf-8"></script>
|
15
|
-
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
16
|
-
charset="utf-8"></script>
|
17
|
-
<script src="../js/quicksearch.js" type="text/javascript"
|
18
|
-
charset="utf-8"></script>
|
19
|
-
<script src="../js/darkfish.js" type="text/javascript"
|
20
|
-
charset="utf-8"></script>
|
21
|
-
</head>
|
22
|
-
|
23
|
-
<body class="file file-popup">
|
24
|
-
<div id="metadata">
|
25
|
-
<dl>
|
26
|
-
<dt class="modified-date">Last Modified</dt>
|
27
|
-
<dd class="modified-date">Sun Feb 12 16:34:30 -0800 2012</dd>
|
28
|
-
|
29
|
-
|
30
|
-
<dt class="requires">Requires</dt>
|
31
|
-
<dd class="requires">
|
32
|
-
<ul>
|
33
|
-
|
34
|
-
<li>app_controller_client</li>
|
35
|
-
|
36
|
-
<li>common_functions</li>
|
37
|
-
|
38
|
-
<li>custom_exceptions</li>
|
39
|
-
|
40
|
-
</ul>
|
41
|
-
</dd>
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
</dl>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
<div id="documentation">
|
49
|
-
|
50
|
-
<div class="description">
|
51
|
-
<h2>Description</h2>
|
52
|
-
|
53
|
-
<p>Programmer: Chris Bunch (cgb@cs.ucsb.edu)</p>
|
54
|
-
|
55
|
-
</div>
|
56
|
-
|
57
|
-
</div>
|
58
|
-
</body>
|
59
|
-
</html>
|
60
|
-
|
data/test/integration/tc_c.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
|
2
|
-
$:.unshift File.join(File.dirname(__FILE__), "..", "..", "lib")
|
3
|
-
require 'neptune'
|
4
|
-
|
5
|
-
$:.unshift File.join(File.dirname(__FILE__), "..", "test", "integration")
|
6
|
-
require 'test_helper'
|
7
|
-
|
8
|
-
require 'test/unit'
|
9
|
-
|
10
|
-
class TestC < Test::Unit::TestCase
|
11
|
-
# unlike the other language interfaces, we don't run c code yet
|
12
|
-
# just compile it - this may change in the future
|
13
|
-
|
14
|
-
def test_c_compile
|
15
|
-
ring_code = <<BAZ
|
16
|
-
#include <stdio.h>
|
17
|
-
|
18
|
-
int main() {
|
19
|
-
printf("hello world!");
|
20
|
-
return 0;
|
21
|
-
}
|
22
|
-
BAZ
|
23
|
-
|
24
|
-
contents = TestHelper.get_random_alphanumeric(1024)
|
25
|
-
folder = "hello-world-#{TestHelper.get_random_alphanumeric}"
|
26
|
-
source = "HelloWorld.c"
|
27
|
-
|
28
|
-
tmp_folder = "/tmp/#{folder}"
|
29
|
-
FileUtils.mkdir_p(tmp_folder)
|
30
|
-
compiled = "#{tmp_folder}-compiled"
|
31
|
-
compiled_code = "#{compiled}/HelloWorld"
|
32
|
-
|
33
|
-
local = "#{tmp_folder}/#{source}"
|
34
|
-
TestHelper.write_file(local, ring_code)
|
35
|
-
|
36
|
-
output = TestHelper.get_output_location(folder)
|
37
|
-
|
38
|
-
compile_c_code(tmp_folder, source, compiled)
|
39
|
-
|
40
|
-
FileUtils.rm_rf(tmp_folder)
|
41
|
-
FileUtils.rm_rf(compiled)
|
42
|
-
end
|
43
|
-
|
44
|
-
def compile_c_code(location, main_file, compiled)
|
45
|
-
std_out, std_err = TestHelper.compile_code(location, main_file, compiled)
|
46
|
-
|
47
|
-
make = "gcc -o HelloWorld HelloWorld.c -Wall"
|
48
|
-
msg = "The C Hello World code did not compile as expected. It should have " +
|
49
|
-
"compiled with the command [#{make}] instead of [#{std_out}]."
|
50
|
-
assert(std_out.include?(make), msg)
|
51
|
-
|
52
|
-
msg = "The C Hello World code did not compile successfully. It reported " +
|
53
|
-
"the following error: #{std_err}"
|
54
|
-
assert_nil(std_err, msg)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
data/test/integration/tc_dfsp.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
|
2
|
-
class TestDFSP < Test::Unit::TestCase
|
3
|
-
def test_dfsp
|
4
|
-
STORAGE_TYPES.each { |storage|
|
5
|
-
run_dfsp(storage)
|
6
|
-
}
|
7
|
-
end
|
8
|
-
|
9
|
-
def run_dfsp(storage)
|
10
|
-
expected_output = "sim_output"
|
11
|
-
contents = TestHelper.get_random_alphanumeric(1024)
|
12
|
-
folder = "dfsp-#{TestHelper.get_random_alphanumeric}"
|
13
|
-
output = TestHelper.get_output_location(folder, storage)
|
14
|
-
|
15
|
-
start_dfsp_code(output, storage)
|
16
|
-
get_dfsp_output(output, expected_output, storage)
|
17
|
-
end
|
18
|
-
|
19
|
-
def start_dfsp_code(output, storage)
|
20
|
-
params = { :simulations => 10 }
|
21
|
-
status = TestHelper.start_job("dfsp", nil, output, storage, params)
|
22
|
-
|
23
|
-
msg = "Your job was not started successfully. The failure message " +
|
24
|
-
"reported was #{status[:msg]}"
|
25
|
-
assert_equal(status[:result], :success, msg)
|
26
|
-
end
|
27
|
-
|
28
|
-
def get_dfsp_output(output, expected, storage)
|
29
|
-
result = TestHelper.get_job_output(output, storage)
|
30
|
-
|
31
|
-
msg = "The DFSP job you ran did not return the expected result. " +
|
32
|
-
"We expected to see [#{expected}] but instead saw [#{result}]"
|
33
|
-
success = result.include?(expected)
|
34
|
-
assert(success, msg)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
@@ -1,38 +0,0 @@
|
|
1
|
-
|
2
|
-
class TestDWSSA < Test::Unit::TestCase
|
3
|
-
def test_dwssa
|
4
|
-
STORAGE_TYPES.each { |storage|
|
5
|
-
run_dwssa(storage)
|
6
|
-
}
|
7
|
-
end
|
8
|
-
|
9
|
-
def run_dwssa(storage)
|
10
|
-
expected_output = ""
|
11
|
-
contents = TestHelper.get_random_alphanumeric(1024)
|
12
|
-
folder = "dwssa-#{TestHelper.get_random_alphanumeric}"
|
13
|
-
output = TestHelper.get_output_location(folder, storage)
|
14
|
-
|
15
|
-
start_dwssa_code(output, storage)
|
16
|
-
get_dwssa_output(output, expected_output, storage)
|
17
|
-
end
|
18
|
-
|
19
|
-
def start_dwssa_code(output, storage)
|
20
|
-
params = { :simulations => 10 }
|
21
|
-
status = TestHelper.start_job("cewssa", nil, output, storage, params)
|
22
|
-
|
23
|
-
msg = "Your job was not started successfully. The failure message " +
|
24
|
-
"reported was #{status[:msg]}"
|
25
|
-
assert_equal(status[:result], :success, msg)
|
26
|
-
end
|
27
|
-
|
28
|
-
def get_dwssa_output(output, expected, storage)
|
29
|
-
result = TestHelper.get_job_output(output, storage)
|
30
|
-
|
31
|
-
msg = "The dwSSA job you ran did not return the expected result. " +
|
32
|
-
"We expected to see [#{expected}] but instead saw [#{result}]"
|
33
|
-
success = result.include?(expected)
|
34
|
-
assert(success, msg)
|
35
|
-
sleep(30) # wait for appscale to free up nodes
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
@@ -1,183 +0,0 @@
|
|
1
|
-
|
2
|
-
class TestErlang < Test::Unit::TestCase
|
3
|
-
def test_ring_code
|
4
|
-
STORAGE_TYPES.each { |storage|
|
5
|
-
run_ring_code(storage)
|
6
|
-
}
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_nonexistent_source_code
|
10
|
-
location = "baz" + TestHelper.get_random_alphanumeric
|
11
|
-
main_file = "boo"
|
12
|
-
compiled = "bazagain"
|
13
|
-
|
14
|
-
msg = "Running a compile job with a non-existent source code location" +
|
15
|
-
" should have thrown an exception, when in fact it did not."
|
16
|
-
|
17
|
-
assert_raise(SystemExit, msg) {
|
18
|
-
TestHelper.compile_code(location, main_file, compiled)
|
19
|
-
}
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_nonexistent_compiled_code
|
23
|
-
location = "baz" + TestHelper.get_random_alphanumeric
|
24
|
-
output = "/bazboo2"
|
25
|
-
storage = "appdb"
|
26
|
-
|
27
|
-
msg = "Running an Erlang compute job with a non-existent code location" +
|
28
|
-
" should have thrown an exception, when in fact it did not."
|
29
|
-
|
30
|
-
assert_raise(SystemExit, msg) {
|
31
|
-
TestHelper.start_job("erlang", location, output, storage)
|
32
|
-
}
|
33
|
-
end
|
34
|
-
|
35
|
-
def run_ring_code(storage)
|
36
|
-
expected_output = "total time for"
|
37
|
-
ring_code = <<BAZ
|
38
|
-
-module(ring).
|
39
|
-
-compile(export_all).
|
40
|
-
|
41
|
-
% spawn N processes
|
42
|
-
% M times, send message to proc 1
|
43
|
-
% when proc i recv's a message, send it to i+1
|
44
|
-
|
45
|
-
% distributed version:
|
46
|
-
% global var for master node
|
47
|
-
% var with list of nodes
|
48
|
-
% if master:
|
49
|
-
% no high-level changes
|
50
|
-
% else:
|
51
|
-
% wait for master to give me work
|
52
|
-
% loop until i receive a kill message
|
53
|
-
% which breaks this loop and kills this node
|
54
|
-
|
55
|
-
% smaller changes:
|
56
|
-
|
57
|
-
start(Name, Next) ->
|
58
|
-
%io:format("creating proc named ~p with next proc named ~p~n", [Name, Next]),
|
59
|
-
register(Name, spawn(fun() -> ring:startMe(Next) end)),
|
60
|
-
Name.
|
61
|
-
|
62
|
-
startMe(Next) ->
|
63
|
-
receive
|
64
|
-
stop ->
|
65
|
-
void;
|
66
|
-
{Message, Initiator} ->
|
67
|
-
NextPid = whereis(Next),
|
68
|
-
if
|
69
|
-
is_pid(NextPid) ->
|
70
|
-
%io:format("sending message to next proc, ~p~n", [Next]),
|
71
|
-
NextPid ! {Message, Initiator},
|
72
|
-
startMe(Next);
|
73
|
-
true ->
|
74
|
-
%io:format("no next proc to send message to!~n"),
|
75
|
-
Initiator ! done,
|
76
|
-
startMe(Next)
|
77
|
-
end
|
78
|
-
end.
|
79
|
-
|
80
|
-
generateProcs(Num) ->
|
81
|
-
if
|
82
|
-
Num > 0 ->
|
83
|
-
[start(ring:i_to_a(Num), ring:i_to_a(Num-1)) | ring:generateProcs(Num-1)];
|
84
|
-
true ->
|
85
|
-
[]
|
86
|
-
end.
|
87
|
-
|
88
|
-
stopProcs([H | T]) ->
|
89
|
-
HeadPid = whereis(H),
|
90
|
-
HeadPid ! stop,
|
91
|
-
stopProcs(T);
|
92
|
-
stopProcs([]) ->
|
93
|
-
void.
|
94
|
-
|
95
|
-
sendMessageToFirst([H | T], Message) ->
|
96
|
-
HeadPid = whereis(H),
|
97
|
-
HeadPid ! {Message, self()},
|
98
|
-
receive
|
99
|
-
done -> void
|
100
|
-
end.
|
101
|
-
|
102
|
-
a_to_i(A) ->
|
103
|
-
list_to_integer(atom_to_list(A)).
|
104
|
-
|
105
|
-
i_to_a(I) ->
|
106
|
-
list_to_atom(integer_to_list(I)).
|
107
|
-
|
108
|
-
times(Num, Fun) ->
|
109
|
-
if Num > 0 ->
|
110
|
-
Fun(),
|
111
|
-
times(Num-1, Fun);
|
112
|
-
true ->
|
113
|
-
void
|
114
|
-
end.
|
115
|
-
|
116
|
-
main() ->
|
117
|
-
statistics(wall_clock),
|
118
|
-
NumProcs = 10,
|
119
|
-
NumMessages = 1,
|
120
|
-
Processes = ring:generateProcs(NumProcs),
|
121
|
-
Message = "hello!",
|
122
|
-
times(NumMessages, fun() -> sendMessageToFirst(Processes, Message) end),
|
123
|
-
ring:stopProcs(Processes),
|
124
|
-
{_, TotalTime} = statistics(wall_clock),
|
125
|
-
TimeInMicroseconds = TotalTime * 1000,
|
126
|
-
io:format("total time for N = ~p, M = ~p, is ~p microseconds~n", [NumProcs, NumMessages, TimeInMicroseconds]),
|
127
|
-
exit('baz').
|
128
|
-
|
129
|
-
BAZ
|
130
|
-
|
131
|
-
contents = TestHelper.get_random_alphanumeric(1024)
|
132
|
-
folder = "ring-#{TestHelper.get_random_alphanumeric}"
|
133
|
-
source = "ring.erl"
|
134
|
-
|
135
|
-
tmp_folder = "/tmp/#{folder}"
|
136
|
-
FileUtils.mkdir_p(tmp_folder)
|
137
|
-
compiled = "#{tmp_folder}-compiled"
|
138
|
-
compiled_code = "#{compiled}/ring.beam"
|
139
|
-
|
140
|
-
local = "#{tmp_folder}/#{source}"
|
141
|
-
TestHelper.write_file(local, ring_code)
|
142
|
-
|
143
|
-
output = TestHelper.get_output_location(folder, storage)
|
144
|
-
|
145
|
-
compile_erlang_code(tmp_folder, source, compiled)
|
146
|
-
start_erlang_code(compiled_code, output, storage)
|
147
|
-
get_erlang_output(output, expected_output, storage)
|
148
|
-
|
149
|
-
FileUtils.rm_rf(tmp_folder)
|
150
|
-
FileUtils.rm_rf(compiled)
|
151
|
-
end
|
152
|
-
|
153
|
-
def compile_erlang_code(location, main_file, compiled)
|
154
|
-
std_out, std_err = TestHelper.compile_code(location, main_file, compiled)
|
155
|
-
|
156
|
-
make = "HOME=/root erlc ring.erl"
|
157
|
-
msg = "The Erlang Ring code did not compile as expected. It should have " +
|
158
|
-
"compiled with the command [#{make}] instead of [#{std_out}]."
|
159
|
-
assert(std_out.include?(make), msg)
|
160
|
-
|
161
|
-
msg = "The Erlang Ring code did not compile successfully. It reported " +
|
162
|
-
"the following error: #{std_err}"
|
163
|
-
assert_nil(std_err, msg)
|
164
|
-
end
|
165
|
-
|
166
|
-
def start_erlang_code(code_location, output, storage)
|
167
|
-
status = TestHelper.start_job("erlang", code_location, output, storage)
|
168
|
-
|
169
|
-
msg = "Your job was not started successfully. The failure message " +
|
170
|
-
"reported was #{status[:msg]}"
|
171
|
-
assert_equal(status[:result], :success, msg)
|
172
|
-
end
|
173
|
-
|
174
|
-
def get_erlang_output(output, expected, storage)
|
175
|
-
result = TestHelper.get_job_output(output, storage)
|
176
|
-
|
177
|
-
msg = "The Erlang job you ran did not return the expected result. " +
|
178
|
-
"We expected to see [#{expected}] but instead saw [#{result}]"
|
179
|
-
out_contains = result.include?(expected)
|
180
|
-
assert(out_contains, msg)
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|