@@ -9,13 +9,18 @@ class RemoteServerJobTest < ActiveJob::TestCase
99 end
1010
1111 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
1924 end
2025
2126 test '#perform ruby_releases' do
@@ -51,21 +56,8 @@ class RemoteServerJobTest < ActiveJob::TestCase
5156 end
5257
5358 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 )
6961
7062 RemoteServerJob . new . perform ( 'commit_hash' , 'ruby_commit_discourse' )
7163 end
0 commit comments