parallelized_specs 0.3.33 → 0.3.34

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.3.33"
15
+ gem.version = "0.3.34"
16
16
  end
17
17
  Jeweler::GemcutterTasks.new
18
18
  rescue LoadError
@@ -119,6 +119,7 @@ class ParallelizedSpecs
119
119
  #exit with correct status code so rake parallel:test && echo 123 works
120
120
  failed = test_results.any? { |result| result[:exit_status] != 0 }
121
121
  if failed && FileTest.exist?("#{RAILS_ROOT}/tmp/parallel_log/rspec.failures")
122
+ puts "some specs failed, about to start the rerun process\n no more than 9 specs may be rerun and shared specs are not allowed"
122
123
  ParallelizedSpecs.rerun()
123
124
  else
124
125
  abort "#{name.capitalize}s Failed" if failed
@@ -274,7 +275,9 @@ class ParallelizedSpecs
274
275
  filename = "#{RAILS_ROOT}/tmp/parallel_log/rspec.failures"
275
276
 
276
277
  @error_count = %x{wc -l "#{filename}"}.match(/\d/).to_s #counts the number of lines in the file
277
- if @error_count.to_i > 1 && @error_count.to_i < 10
278
+ @error_count = @error_count.to_i
279
+
280
+ if @error_count > 1 && @error_count < 10
278
281
 
279
282
  File.open(filename).each_line do |line|
280
283
  if line =~ /spec\/selenium\/helpers/ || line =~ /spec\/selenium\/shared_examples/
@@ -296,7 +299,7 @@ class ParallelizedSpecs
296
299
  rerun_status = result.match(/1 example, \d failure/).to_s
297
300
 
298
301
  case rerun_status
299
- when ""
302
+ when "" #when specs fail to run it exits with 0 examples, 0 failures and won't be matched by the previous regex
300
303
  abort "the spec failed to run on the rerun try, marking build as failed"
301
304
  when "1 example, 1 failure"
302
305
  puts "the example failed again"
@@ -309,9 +312,9 @@ class ParallelizedSpecs
309
312
  end
310
313
  rerun_status = ""
311
314
  end #end file loop
312
- elsif @error_count.to_i == 0
315
+ elsif @error_count == 0
313
316
  abort "#{@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"
314
- elsif @error_count.to_i > 10
317
+ elsif @error_count > 10
315
318
  abort "#{error_count} errors are to many to rerun, marking the build as a failure"
316
319
  else
317
320
  abort "unexpected error information, please check errors are being written to file correctly"
@@ -320,7 +323,7 @@ class ParallelizedSpecs
320
323
  if rerun_failed_examples
321
324
  if @rerun_failures.count > 0
322
325
  abort "some specs failed on rerun, the build will be marked as failed"
323
- elsif @rerun_passes.count >= @error_count.to_i
326
+ elsif @rerun_passes.count >= @error_count
324
327
  puts "all rerun examples passed, rspec will mark this build as passed"
325
328
  else
326
329
  abort "unexpected situation on rerun, marking build as failure"
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "parallelized_specs"
8
- s.version = "0.3.33"
8
+ s.version = "0.3.34"
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: 81
4
+ hash: 87
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 33
10
- version: 0.3.33
9
+ - 34
10
+ version: 0.3.34
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jake Sorce, Bryan Madsen, Shawn Meredith