@@ -9,13 +9,18 @@ class RemoteServerJobTest < ActiveJob::TestCase
9
9
end
10
10
11
11
test '#perform ruby_commit' do
12
- @ssh . expects ( :exec! ) . with (
13
- "tsp #{ RemoteServerJob ::RUBY_COMMIT } #{ @ruby } #{ @memory } #{ @optcarrot } #{ @liquid } #{ @commit_hash } #{ @api_name } #{ @api_password } #{ @patterns } "
14
- )
15
-
16
- RemoteServerJob . new . perform (
17
- @commit_hash , 'ruby_commit' , include_patterns : @patterns
18
- )
12
+ begin
13
+ @liquid = false
14
+ @ssh . expects ( :exec! ) . with (
15
+ "tsp #{ RemoteServerJob ::RUBY_COMMIT } #{ @ruby } #{ @memory } #{ @optcarrot } #{ @liquid } #{ @commit_hash } #{ @api_name } #{ @api_password } #{ @patterns } "
16
+ )
17
+
18
+ RemoteServerJob . new . perform (
19
+ @commit_hash , 'ruby_commit' , include_patterns : @patterns
20
+ )
21
+ ensure
22
+ @liquid = true
23
+ end
19
24
end
20
25
21
26
test '#perform ruby_releases' do
@@ -51,21 +56,8 @@ class RemoteServerJobTest < ActiveJob::TestCase
51
56
end
52
57
53
58
test '#perform ruby_commit_discourse' do
54
- [
55
- 'tsp docker pull rubybench/ruby_trunk_discourse' ,
56
- 'tsp docker run --name discourse_redis -d redis:2.8.19' ,
57
- 'tsp docker run --name discourse_postgres -d postgres:9.3.5' ,
58
- "tsp docker run --rm --link discourse_postgres:postgres
59
- --link discourse_redis:redis -e \" RUBY_COMMIT_HASH=commit_hash\"
60
- -e \" API_NAME=#{ @api_name } \"
61
- -e \" API_PASSWORD=#{ @api_password } \"
62
- rubybench/ruby_trunk_discourse" . squish ,
63
- 'tsp docker stop discourse_postgres discourse_redis' ,
64
- 'tsp docker rm -v discourse_postgres discourse_redis'
65
- ] . each do |command |
66
-
67
- @ssh . expects ( :exec! ) . with ( command )
68
- end
59
+ command = "tsp #{ RemoteServerJob ::RUBY_COMMIT_DISCOURSE } commit_hash #{ @api_name } #{ @api_password } "
60
+ @ssh . expects ( :exec! ) . with ( command )
69
61
70
62
RemoteServerJob . new . perform ( 'commit_hash' , 'ruby_commit_discourse' )
71
63
end
0 commit comments