Skip to content

Commit 366a9bc

Browse files
author
bmarkons
committed
Rename RemoteServerJob methods
1 parent 04d2162 commit 366a9bc

2 files changed

Lines changed: 41 additions & 41 deletions

File tree

app/jobs/remote_server_job.rb

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ class RemoteServerJob < ActiveJob::Base
55

66
SCRIPTS_PATH = './ruby-bench-docker/scripts'
77

8-
RUBY_TRUNK = "#{SCRIPTS_PATH}/ruby/trunk.sh"
8+
RUBY_COMMIT = "#{SCRIPTS_PATH}/ruby/trunk.sh"
99
RUBY_RELEASE = "#{SCRIPTS_PATH}/ruby/releases.sh"
1010

11-
RAILS_MASTER = "#{SCRIPTS_PATH}/rails/master.sh"
11+
RAILS_COMMIT = "#{SCRIPTS_PATH}/rails/master.sh"
1212
RAILS_RELEASE = "#{SCRIPTS_PATH}/rails/releases.sh"
1313

14-
SEQUEL_MASTER = "#{SCRIPTS_PATH}/sequel/master.sh"
14+
SEQUEL_COMMIT = "#{SCRIPTS_PATH}/sequel/master.sh"
1515
SEQUEL_RELEASE = "#{SCRIPTS_PATH}/sequel/releases.sh"
1616

1717
BUNDLER_RELEASE = "#{SCRIPTS_PATH}/bundler/releases.sh"
1818

19-
PG_MASTER = "#{SCRIPTS_PATH}/pg/master.sh"
19+
PG_COMMIT = "#{SCRIPTS_PATH}/pg/master.sh"
2020

2121
# Use keyword arguments once Rails 4.2.1 has been released.
2222
def perform(initiator_key, benchmark_group, options = {})
@@ -32,7 +32,7 @@ def perform(initiator_key, benchmark_group, options = {})
3232

3333
private
3434

35-
def ruby_trunk(ssh, commit_hash, options)
35+
def ruby_commit(ssh, commit_hash, options)
3636
ruby = true
3737
memory = true
3838
optcarrot = true
@@ -41,11 +41,11 @@ def ruby_trunk(ssh, commit_hash, options)
4141

4242
ssh_exec!(
4343
ssh,
44-
"#{RUBY_TRUNK} #{ruby} #{memory} #{optcarrot} #{liquid} #{commit_hash} #{secrets.api_name} #{secrets.api_password} #{patterns}"
44+
"#{RUBY_COMMIT} #{ruby} #{memory} #{optcarrot} #{liquid} #{commit_hash} #{secrets.api_name} #{secrets.api_password} #{patterns}"
4545
)
4646
end
4747

48-
def ruby_releases(ssh, version, options)
48+
def ruby_release(ssh, version, options)
4949
ruby = true
5050
memory = true
5151
optcarrot = true
@@ -58,7 +58,7 @@ def ruby_releases(ssh, version, options)
5858
)
5959
end
6060

61-
def ruby_releases_discourse(ssh, ruby_version, options)
61+
def ruby_release_discourse(ssh, ruby_version, options)
6262
execute_ssh_commands(ssh,
6363
[
6464
'docker pull rubybench/ruby_releases_discourse',
@@ -77,7 +77,7 @@ def ruby_releases_discourse(ssh, ruby_version, options)
7777
)
7878
end
7979

80-
def ruby_trunk_discourse(ssh, commit_hash, options)
80+
def ruby_commit_discourse(ssh, commit_hash, options)
8181
execute_ssh_commands(ssh,
8282
[
8383
'docker pull rubybench/ruby_trunk_discourse',
@@ -94,41 +94,41 @@ def ruby_trunk_discourse(ssh, commit_hash, options)
9494
)
9595
end
9696

97-
def rails_releases(ssh, version, options)
97+
def rails_release(ssh, version, options)
9898
prepared_statements = if version >= '4.2.5' then 1 else 0 end
9999
patterns = options[:include_patterns]
100100

101101
ssh_exec!(ssh, "#{RAILS_RELEASE} #{version} #{secrets.api_name} #{secrets.api_password} #{prepared_statements} #{patterns}")
102102
end
103103

104-
def rails_trunk(ssh, commit_hash, options)
104+
def rails_commit(ssh, commit_hash, options)
105105
patterns = options[:include_patterns]
106106

107-
ssh_exec!(ssh, "#{RAILS_MASTER} #{commit_hash} #{secrets.api_name} #{secrets.api_password} #{patterns}")
107+
ssh_exec!(ssh, "#{RAILS_COMMIT} #{commit_hash} #{secrets.api_name} #{secrets.api_password} #{patterns}")
108108
end
109109

110-
def sequel_releases(ssh, version, options)
110+
def sequel_release(ssh, version, options)
111111
patterns = options[:include_patterns]
112112

113113
ssh_exec!(ssh, "#{SEQUEL_RELEASE} #{version} #{secrets.api_name} #{secrets.api_password} #{patterns}")
114114
end
115115

116-
def sequel_trunk(ssh, commit_hash, options)
116+
def sequel_commit(ssh, commit_hash, options)
117117
patterns = options[:include_patterns]
118118

119-
ssh_exec!(ssh, "#{SEQUEL_MASTER} #{commit_hash} #{secrets.api_name} #{secrets.api_password} #{patterns}")
119+
ssh_exec!(ssh, "#{SEQUEL_COMMIT} #{commit_hash} #{secrets.api_name} #{secrets.api_password} #{patterns}")
120120
end
121121

122-
def bundler_releases(ssh, version, options)
122+
def bundler_release(ssh, version, options)
123123
patterns = options[:include_patterns]
124124

125125
ssh_exec!(ssh, "#{BUNDLER_RELEASE} #{version} #{secrets.api_name} #{secrets.api_password} #{patterns}")
126126
end
127127

128-
def pg_master(ssh, commit_hash, options)
128+
def pg_commit(ssh, commit_hash, options)
129129
patterns = options[:include_patterns]
130130

131-
ssh_exec!(ssh, "#{PG_MASTER} #{commit_hash} #{secrets.api_name} #{secrets.api_password} #{patterns}")
131+
ssh_exec!(ssh, "#{PG_COMMIT} #{commit_hash} #{secrets.api_name} #{secrets.api_password} #{patterns}")
132132
end
133133

134134
def execute_ssh_commands(ssh, commands)

test/jobs/remote_server_job_test.rb

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ class RemoteServerJobTest < ActiveJob::TestCase
88
set_script_arguments
99
end
1010

11-
test '#perform ruby_trunk' do
11+
test '#perform ruby_commit' do
1212
@ssh.expects(:exec!).with(
13-
"tsp #{RemoteServerJob::RUBY_TRUNK} #{@ruby} #{@memory} #{@optcarrot} #{@liquid} #{@commit_hash} #{@api_name} #{@api_password} #{@patterns}"
13+
"tsp #{RemoteServerJob::RUBY_COMMIT} #{@ruby} #{@memory} #{@optcarrot} #{@liquid} #{@commit_hash} #{@api_name} #{@api_password} #{@patterns}"
1414
)
1515

1616
RemoteServerJob.new.perform(
17-
@commit_hash, 'ruby_trunk', include_patterns: @patterns
17+
@commit_hash, 'ruby_commit', include_patterns: @patterns
1818
)
1919
end
2020

@@ -24,11 +24,11 @@ class RemoteServerJobTest < ActiveJob::TestCase
2424
)
2525

2626
RemoteServerJob.new.perform(
27-
@version, 'ruby_releases', include_patterns: @patterns
27+
@version, 'ruby_release', include_patterns: @patterns
2828
)
2929
end
3030

31-
test '#perform ruby_releases_discourse' do
31+
test '#perform ruby_release_discourse' do
3232
[
3333
'tsp docker pull rubybench/ruby_releases_discourse',
3434
'tsp docker run --name discourse_redis -d redis:2.8.19',
@@ -47,10 +47,10 @@ class RemoteServerJobTest < ActiveJob::TestCase
4747
@ssh.expects(:exec!).with(command)
4848
end
4949

50-
RemoteServerJob.new.perform('2.2.0', 'ruby_releases_discourse')
50+
RemoteServerJob.new.perform('2.2.0', 'ruby_release_discourse')
5151
end
5252

53-
test '#perform ruby_trunk_discourse' do
53+
test '#perform ruby_commit_discourse' do
5454
[
5555
'tsp docker pull rubybench/ruby_trunk_discourse',
5656
'tsp docker run --name discourse_redis -d redis:2.8.19',
@@ -67,66 +67,66 @@ class RemoteServerJobTest < ActiveJob::TestCase
6767
@ssh.expects(:exec!).with(command)
6868
end
6969

70-
RemoteServerJob.new.perform('commit_hash', 'ruby_trunk_discourse')
70+
RemoteServerJob.new.perform('commit_hash', 'ruby_commit_discourse')
7171
end
7272

73-
test '#perform rails_releases' do
73+
test '#perform rails_release' do
7474
@ssh.expects(:exec!).with(
7575
"tsp #{RemoteServerJob::RAILS_RELEASE} #{@version} #{@api_name} #{@api_password} 0 #{@patterns}"
7676
)
7777

7878
RemoteServerJob.new.perform(
79-
@version, 'rails_releases', include_patterns: @patterns
79+
@version, 'rails_release', include_patterns: @patterns
8080
)
8181
end
8282

83-
test '#perform rails_trunk' do
83+
test '#perform rails_commit' do
8484
@ssh.expects(:exec!).with(
85-
"tsp #{RemoteServerJob::RAILS_MASTER} #{@commit_hash} #{@api_name} #{@api_password} #{@patterns}"
85+
"tsp #{RemoteServerJob::RAILS_COMMIT} #{@commit_hash} #{@api_name} #{@api_password} #{@patterns}"
8686
)
8787

8888
RemoteServerJob.new.perform(
89-
@commit_hash, 'rails_trunk', include_patterns: @patterns
89+
@commit_hash, 'rails_commit', include_patterns: @patterns
9090
)
9191
end
9292

93-
test '#perform sequel_releases' do
93+
test '#perform sequel_release' do
9494
@ssh.expects(:exec!).with(
9595
"tsp #{RemoteServerJob::SEQUEL_RELEASE} #{@version} #{@api_name} #{@api_password} #{@patterns}"
9696
)
9797

9898
RemoteServerJob.new.perform(
99-
@version, 'sequel_releases', include_patterns: @patterns
99+
@version, 'sequel_release', include_patterns: @patterns
100100
)
101101
end
102102

103-
test '#perform sequel_trunk' do
103+
test '#perform sequel_commit' do
104104
@ssh.expects(:exec!).with(
105-
"tsp #{RemoteServerJob::SEQUEL_MASTER} #{@commit_hash} #{@api_name} #{@api_password} #{@patterns}"
105+
"tsp #{RemoteServerJob::SEQUEL_COMMIT} #{@commit_hash} #{@api_name} #{@api_password} #{@patterns}"
106106
)
107107

108108
RemoteServerJob.new.perform(
109-
@commit_hash, 'sequel_trunk', include_patterns: @patterns
109+
@commit_hash, 'sequel_commit', include_patterns: @patterns
110110
)
111111
end
112112

113-
test '#perform bundler_releases' do
113+
test '#perform bundler_release' do
114114
@ssh.expects(:exec!).with(
115115
"tsp #{RemoteServerJob::BUNDLER_RELEASE} #{@version} #{@api_name} #{@api_password} #{@patterns}"
116116
)
117117

118118
RemoteServerJob.new.perform(
119-
@version, 'bundler_releases', include_patterns: @patterns
119+
@version, 'bundler_release', include_patterns: @patterns
120120
)
121121
end
122122

123-
test '#perform pg_master' do
123+
test '#perform pg_commit' do
124124
@ssh.expects(:exec!).with(
125-
"tsp #{RemoteServerJob::PG_MASTER} #{@commit_hash} #{@api_name} #{@api_password} #{@patterns}"
125+
"tsp #{RemoteServerJob::PG_COMMIT} #{@commit_hash} #{@api_name} #{@api_password} #{@patterns}"
126126
)
127127

128128
RemoteServerJob.new.perform(
129-
@commit_hash, 'pg_master', include_patterns: @patterns
129+
@commit_hash, 'pg_commit', include_patterns: @patterns
130130
)
131131
end
132132

0 commit comments

Comments
 (0)