parallelized_specs 0.4.29 → 0.4.30
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +14 -14
- data/Rakefile +1 -1
- data/lib/parallelized_specs.rb +23 -23
- data/parallelized_specs.gemspec +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
diff-lcs (1.
|
4
|
+
diff-lcs (1.1.3)
|
5
5
|
git (1.2.5)
|
6
6
|
jeweler (1.8.4)
|
7
7
|
bundler (~> 1.0)
|
8
8
|
git (>= 1.2.5)
|
9
9
|
rake
|
10
10
|
rdoc
|
11
|
-
json (1.7.
|
12
|
-
parallel (0.
|
13
|
-
rake (
|
14
|
-
rdoc (
|
11
|
+
json (1.7.5)
|
12
|
+
parallel (0.5.19)
|
13
|
+
rake (0.9.2.2)
|
14
|
+
rdoc (3.12)
|
15
15
|
json (~> 1.4)
|
16
|
-
rspec (2.
|
17
|
-
rspec-core (~> 2.
|
18
|
-
rspec-expectations (~> 2.
|
19
|
-
rspec-mocks (~> 2.
|
20
|
-
rspec-core (2.
|
21
|
-
rspec-expectations (2.
|
22
|
-
diff-lcs (
|
23
|
-
rspec-mocks (2.
|
24
|
-
test-unit (2.5.
|
16
|
+
rspec (2.11.0)
|
17
|
+
rspec-core (~> 2.11.0)
|
18
|
+
rspec-expectations (~> 2.11.0)
|
19
|
+
rspec-mocks (~> 2.11.0)
|
20
|
+
rspec-core (2.11.1)
|
21
|
+
rspec-expectations (2.11.3)
|
22
|
+
diff-lcs (~> 1.1.3)
|
23
|
+
rspec-mocks (2.11.3)
|
24
|
+
test-unit (2.5.2)
|
25
25
|
|
26
26
|
PLATFORMS
|
27
27
|
ruby
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ begin
|
|
12
12
|
gem.email = "jake@instructure.com"
|
13
13
|
gem.homepage = "http://github.com/jakesorce/#{gem.name}"
|
14
14
|
gem.authors = "Jake Sorce, Bryan Madsen, Shawn Meredith"
|
15
|
-
gem.version = "0.4.
|
15
|
+
gem.version = "0.4.30"
|
16
16
|
end
|
17
17
|
Jeweler::GemcutterTasks.new
|
18
18
|
rescue LoadError
|
data/lib/parallelized_specs.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'parallel'
|
2
|
+
require 'parallel'
|
2
3
|
raise "please ' gem install parallel '" if Gem::Version.new(Parallel::VERSION) < Gem::Version.new('0.4.2')
|
3
4
|
require 'parallelized_specs/grouper'
|
4
5
|
require 'parallelized_specs/railtie'
|
@@ -153,22 +154,6 @@ class ParallelizedSpecs
|
|
153
154
|
puts "INFO: marking build as PASSED"
|
154
155
|
end
|
155
156
|
|
156
|
-
# parallel:spec[:count, :pattern, :options]
|
157
|
-
def self.parse_rake_args(args)
|
158
|
-
# order as given by user
|
159
|
-
args = [args[:count], args[:pattern]]
|
160
|
-
|
161
|
-
# count given or empty ?
|
162
|
-
count = args.shift if args.first.to_s =~ /^\d*$/
|
163
|
-
num_processes = count.to_i unless count.to_s.empty?
|
164
|
-
num_processes ||= ENV['PARALLEL_TEST_PROCESSORS'].to_i if ENV['PARALLEL_TEST_PROCESSORS']
|
165
|
-
num_processes ||= Parallel.processor_count
|
166
|
-
|
167
|
-
pattern = args.shift
|
168
|
-
|
169
|
-
[num_processes.to_i, pattern.to_s]
|
170
|
-
end
|
171
|
-
|
172
157
|
def self.slowest_spec_determination(file)
|
173
158
|
if File.exists?(file)
|
174
159
|
spec_durations = []
|
@@ -195,6 +180,22 @@ class ParallelizedSpecs
|
|
195
180
|
end
|
196
181
|
end
|
197
182
|
|
183
|
+
# parallel:spec[:count, :pattern, :options]
|
184
|
+
def self.parse_rake_args(args)
|
185
|
+
# order as given by user
|
186
|
+
args = [args[:count], args[:pattern]]
|
187
|
+
|
188
|
+
# count given or empty ?
|
189
|
+
count = args.shift if args.first.to_s =~ /^\d*$/
|
190
|
+
num_processes = count.to_i unless count.to_s.empty?
|
191
|
+
num_processes ||= ENV['PARALLEL_TEST_PROCESSORS'].to_i if ENV['PARALLEL_TEST_PROCESSORS']
|
192
|
+
num_processes ||= Parallel.processor_count
|
193
|
+
|
194
|
+
pattern = args.shift
|
195
|
+
|
196
|
+
[num_processes.to_i, pattern.to_s]
|
197
|
+
end
|
198
|
+
|
198
199
|
# finds all tests and partitions them into groups
|
199
200
|
def self.tests_in_groups(tests, num_groups, options)
|
200
201
|
if options[:no_sort]
|
@@ -331,8 +332,7 @@ class ParallelizedSpecs
|
|
331
332
|
#can't just use exit code, if specs fail to start it will pass or if a spec isn't found, and sometimes rspec 1 exit codes aren't right
|
332
333
|
rerun_status = result.scan(/\d*[^\D]\d*/).to_a
|
333
334
|
puts "INFO: this is the rerun_status\n#{rerun_status}"
|
334
|
-
|
335
|
-
@examples = rerun_status[example_index].to_i
|
335
|
+
@examples = rerun_status[-2].to_i
|
336
336
|
@failures = rerun_status.last.to_i
|
337
337
|
end
|
338
338
|
|
@@ -375,7 +375,7 @@ class ParallelizedSpecs
|
|
375
375
|
abort "SEVERE: #{@error_count} errors, but the build failed, errors were not written to the file or there is something else wrong, marking build as a failure"
|
376
376
|
when code == 6
|
377
377
|
print_failures("#{RAILS_ROOT}/tmp/parallel_log/error.log")
|
378
|
-
abort "SEVERE: #{@error_count} errors are to many to rerun, marking the build as a failure"
|
378
|
+
abort "SEVERE: #{@error_count} errors are to many to rerun, marking the build as a failure. Max errors defined for this build is #{@max_reruns}"
|
379
379
|
when code == 7
|
380
380
|
puts "#Total errors #{@error_count}"
|
381
381
|
abort "SEVERE: unexpected error information, please check errors are being written to file correctly"
|
@@ -410,15 +410,16 @@ class ParallelizedSpecs
|
|
410
410
|
@error_count = %x{wc -l "#{@filename}"}.match(/\d*[^\D]/).to_s #counts the number of lines in the file
|
411
411
|
@error_count = @error_count.to_i
|
412
412
|
puts "INFO: error count = #@error_count"
|
413
|
+
ENV["RERUNS"] != nil ? @max_reruns = ENV["RERUNS"].to_i : @max_reruns = 9
|
413
414
|
|
414
|
-
if !@error_count.between?(1,
|
415
|
+
if !@error_count.between?(1, @max_reruns)
|
415
416
|
puts "INFO: total errors are not in rerun eligibility range"
|
416
417
|
case
|
417
418
|
when @error_count == 0
|
418
419
|
puts "INFO: 0 errors build being aborted"
|
419
420
|
abort_reruns(5)
|
420
|
-
when @error_count >
|
421
|
-
puts "INFO: error count has exceeded maximum errors of
|
421
|
+
when @error_count > @max_reruns
|
422
|
+
puts "INFO: error count has exceeded maximum errors of #{@max_reruns}"
|
422
423
|
abort_reruns(6)
|
423
424
|
else
|
424
425
|
abort_reruns(7)
|
@@ -477,7 +478,6 @@ class ParallelizedSpecs
|
|
477
478
|
|
478
479
|
|
479
480
|
def self.determine_rerun_outcome
|
480
|
-
|
481
481
|
if @rerun_failures.count > 0
|
482
482
|
abort_reruns(8)
|
483
483
|
elsif @rerun_passes.count >= @error_count
|
data/parallelized_specs.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "parallelized_specs"
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.30"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jake Sorce, Bryan Madsen, Shawn Meredith"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallelized_specs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 30
|
10
|
+
version: 0.4.30
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jake Sorce, Bryan Madsen, Shawn Meredith
|