parallelized_specs 0.4.24 → 0.4.25

Sign up to get free protection for your applications and to get access to all the features.
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.24"
15
+ gem.version = "0.4.25"
16
16
  end
17
17
  Jeweler::GemcutterTasks.new
18
18
  rescue LoadError
@@ -301,18 +301,17 @@ class ParallelizedSpecs
301
301
  def self.parse_result(result)
302
302
  puts "INFO: this is the result\n#{result}"
303
303
  #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
304
- rerun_status = result.scan(/\d*[^\D]\d*/).to_s
304
+ rerun_status = result.scan(/\d*[^\D]\d*/).to_a
305
305
  puts "INFO: this is the rerun_status\n#{rerun_status}"
306
- example_index = rerun_status.length - 2
307
- @examples = rerun_status[example_index].to_i
306
+ @examples = rerun_status[-2].to_i
308
307
  @failures = rerun_status.last.to_i
309
308
  end
310
309
 
311
310
  def self.rerun_spec(spec)
312
311
  puts "INFO: #{spec} will be ran and marked as a success if it passes"
313
312
  result = ""
314
- @examples = 0
315
- @failures = 0
313
+ @examples =
314
+ @failures = nil
316
315
  result = %x[DISPLAY=:99 bundle exec rake spec #{spec}]
317
316
  parse_result(result)
318
317
  result
@@ -347,7 +346,7 @@ class ParallelizedSpecs
347
346
  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"
348
347
  when code == 6
349
348
  print_failures("#{RAILS_ROOT}/tmp/parallel_log/error.log")
350
- abort "SEVERE: #{@error_count} errors are to many to rerun, marking the build as a failure"
349
+ 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}"
351
350
  when code == 7
352
351
  puts "#Total errors #{@error_count}"
353
352
  abort "SEVERE: unexpected error information, please check errors are being written to file correctly"
@@ -382,15 +381,18 @@ class ParallelizedSpecs
382
381
  @error_count = %x{wc -l "#{@filename}"}.match(/\d*[^\D]/).to_s #counts the number of lines in the file
383
382
  @error_count = @error_count.to_i
384
383
  puts "INFO: error count = #@error_count"
384
+ ENV["RERUNS"] != nil ? @max_reruns = ENV["RERUNS"].to_i : @max_reruns = 9
385
+ system("unset RERUNS")
385
386
 
386
- if !@error_count.between?(1, 9)
387
+
388
+ if !@error_count.between?(1, @max_reruns)
387
389
  puts "INFO: total errors are not in rerun eligibility range"
388
390
  case
389
391
  when @error_count == 0
390
392
  puts "INFO: 0 errors build being aborted"
391
393
  abort_reruns(5)
392
- when @error_count > 9
393
- puts "INFO: error count has exceeded maximum errors of 9"
394
+ when @error_count > @max_reruns
395
+ puts "INFO: error count has exceeded maximum errors of #{@max_reruns}"
394
396
  abort_reruns(6)
395
397
  else
396
398
  abort_reruns(7)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "parallelized_specs"
8
- s.version = "0.4.24"
8
+ s.version = "0.4.25"
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: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 24
10
- version: 0.4.24
9
+ - 25
10
+ version: 0.4.25
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jake Sorce, Bryan Madsen, Shawn Meredith