serverspec-runner 1.1.5 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3cfa3c89a3827037a931f66c592ae08dbf90f06d
4
- data.tar.gz: a57c6f8f571379d0d6f6f4fb148aed25039d0ff6
3
+ metadata.gz: 6bea70ba7b7c9f06e8051f853b09e7b467465e8f
4
+ data.tar.gz: 7bef214aaa76dae41f957ec915b5f370523b0b02
5
5
  SHA512:
6
- metadata.gz: de14013f8f67c4323642a246379f10ace822969952fd6a725e53e510c97743d9467161949971357a07289f76492b9a8c4a6297851d5a478411d58b4a33508a41
7
- data.tar.gz: c9bcee28759fa3a6b3792d84d9b32053cba03948e6f01565c9dacba80413339b04592b7f8161a442eb3b90edffe48202f6fbdaa7522ccb5d52920b645fd3e128
6
+ metadata.gz: 42ba71e3fc70002f36c8a2f41fb269f1e4d2800b6ba0432403445b9359ae5db5b913c5698be2032d06fe8513d7aafb48f4ef3d7574730f2133eb1093b600029f
7
+ data.tar.gz: 3f377bbefbcb907060beb5acc1712bdcc10f67733d656e1431f14182bd0f76c716318515ec1ea9f454dc6fb859646acf701f5cc6830c1cd7f54ea15df6688a8b
data/Rakefile CHANGED
@@ -178,7 +178,7 @@ namespace :spec do
178
178
  tasks = []
179
179
  gen_exec_plan(nil, scenarios, [], ssh_options, tasks, platform)
180
180
 
181
- task :stdout => [:test] do
181
+ task :stdout do
182
182
 
183
183
  if ENV['tableformat'] == 'bool'
184
184
 
@@ -245,13 +245,30 @@ namespace :spec do
245
245
  end
246
246
  end
247
247
 
248
- if ENV['exec_mode'] == 'parallel'
249
- multitask :test => tasks
248
+ exec_tasks = []
249
+ if ENV['parallels']
250
+ processes = ENV['parallels'].to_i
251
+
252
+ split_group = []
253
+ groups = 0
254
+ tasks.each_with_index do |t,pos|
255
+
256
+ split_group << t
257
+
258
+ if pos % processes == 0 || pos == tasks.length - 1
259
+ multitask "parallel_tasks_#{groups}".to_s => split_group
260
+ groups += 1
261
+ split_group = []
262
+ end
263
+ end
264
+
265
+ groups.times {|i| exec_tasks << "parallel_tasks_#{i}" }
250
266
  else
251
- task :test => tasks
267
+ exec_tasks = tasks
252
268
  end
253
269
 
254
- task :all => [:stdout]
270
+ exec_tasks << :stdout
271
+ task :all => exec_tasks
255
272
 
256
273
  # tempファイルに書き出し
257
274
  open(ENV['platforms_tmp'] ,"w") do |y|
@@ -15,7 +15,7 @@ opts = GetoptLong.new(
15
15
  ["--ssh_options", "-o", GetoptLong::REQUIRED_ARGUMENT],
16
16
  ["--explain", "-e", GetoptLong::REQUIRED_ARGUMENT],
17
17
  ["--tableformat", "-t", GetoptLong::REQUIRED_ARGUMENT],
18
- ["--parallel", "-p", GetoptLong::NO_ARGUMENT],
18
+ ["--parallel", "-p", GetoptLong::REQUIRED_ARGUMENT],
19
19
  ["--help", "-h", GetoptLong::NO_ARGUMENT],
20
20
  ["--tmpdir", "-1", GetoptLong::REQUIRED_ARGUMENT],
21
21
  ["--raketask", "-2", GetoptLong::REQUIRED_ARGUMENT],
@@ -35,7 +35,7 @@ opts.each do |opt, arg|
35
35
  when '--tableformat'
36
36
  ENV['tableformat'] = arg
37
37
  when '--parallel'
38
- ENV['exec_mode'] = 'parallel'
38
+ ENV['parallels'] = arg
39
39
  when '--tmpdir'
40
40
  ENV['tmpdir'] = arg
41
41
  when '--raketask'
@@ -1,3 +1,3 @@
1
1
  module ServerspecRunner
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - hiracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-13 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serverspec