parallelized_specs 0.3.34 → 0.3.35
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/parallelized_specs.rb +43 -40
- data/parallelized_specs.gemspec +1 -1
- metadata +3 -3
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.
|
15
|
+
gem.version = "0.3.35"
|
16
16
|
end
|
17
17
|
Jeweler::GemcutterTasks.new
|
18
18
|
rescue LoadError
|
data/lib/parallelized_specs.rb
CHANGED
@@ -119,7 +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
|
+
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\n...\n..\n."
|
123
123
|
ParallelizedSpecs.rerun()
|
124
124
|
else
|
125
125
|
abort "#{name.capitalize}s Failed" if failed
|
@@ -277,47 +277,50 @@ class ParallelizedSpecs
|
|
277
277
|
@error_count = %x{wc -l "#{filename}"}.match(/\d/).to_s #counts the number of lines in the file
|
278
278
|
@error_count = @error_count.to_i
|
279
279
|
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
else
|
286
|
-
rerun_specs.push line
|
287
|
-
end
|
288
|
-
end
|
289
|
-
|
290
|
-
puts "rerunning #{@error_count} examples again"
|
291
|
-
@rerun_failures ||= []
|
292
|
-
@rerun_passes ||= []
|
293
|
-
|
294
|
-
rerun_specs.each do |l|
|
295
|
-
rerun_failed_examples = true
|
296
|
-
puts "#{l} will be ran and marked as a success if it passes"
|
297
|
-
result = %x[bundle exec rake spec #{l}]
|
298
|
-
#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
|
299
|
-
rerun_status = result.match(/1 example, \d failure/).to_s
|
300
|
-
|
301
|
-
case rerun_status
|
302
|
-
when "" #when specs fail to run it exits with 0 examples, 0 failures and won't be matched by the previous regex
|
303
|
-
abort "the spec failed to run on the rerun try, marking build as failed"
|
304
|
-
when "1 example, 1 failure"
|
305
|
-
puts "the example failed again"
|
306
|
-
@rerun_failures << l
|
307
|
-
when "1 example, 0 failure"
|
308
|
-
puts "the example passed and is being marked as a success"
|
309
|
-
@rerun_passes << l
|
280
|
+
case
|
281
|
+
when @error_count.between?(1, 9)
|
282
|
+
File.open(filename).each_line do |line|
|
283
|
+
if line =~ /spec\/selenium\/helpers/ || line =~ /spec\/selenium\/shared_examples/
|
284
|
+
abort "shared specs currently are not eligiable for reruns, marking build as a failure"
|
310
285
|
else
|
311
|
-
|
286
|
+
rerun_specs.push line
|
287
|
+
end
|
288
|
+
puts "failed specs will be rerun"
|
312
289
|
end
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
290
|
+
|
291
|
+
puts "rerunning #{@error_count} examples again"
|
292
|
+
@rerun_failures ||= []
|
293
|
+
@rerun_passes ||= []
|
294
|
+
|
295
|
+
rerun_specs.each do |l|
|
296
|
+
rerun_failed_examples = true
|
297
|
+
puts "#{l} will be ran and marked as a success if it passes"
|
298
|
+
result = %x[bundle exec rake spec #{l}]
|
299
|
+
#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
|
300
|
+
rerun_status = result.match(/1 example, \d failure/).to_s
|
301
|
+
|
302
|
+
case rerun_status
|
303
|
+
when "" #when specs fail to run it exits with 0 examples, 0 failures and won't be matched by the previous regex
|
304
|
+
abort "the spec failed to run on the rerun try, marking build as failed"
|
305
|
+
when "1 example, 1 failure"
|
306
|
+
puts "the example failed again"
|
307
|
+
@rerun_failures << l
|
308
|
+
when "1 example, 0 failure"
|
309
|
+
puts "the example passed and is being marked as a success"
|
310
|
+
@rerun_passes << l
|
311
|
+
else
|
312
|
+
abort "unexpected outcome on the rerun, marking build as a failure"
|
313
|
+
end
|
314
|
+
rerun_status = ""
|
315
|
+
end #end file loop
|
316
|
+
|
317
|
+
when @error_count == 0
|
318
|
+
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"
|
319
|
+
when @error_count > 9
|
320
|
+
abort "#{error_count} errors are to many to rerun, marking the build as a failure"
|
321
|
+
else
|
322
|
+
puts "#Total errors {@error_count}"
|
323
|
+
abort "unexpected error information, please check errors are being written to file correctly"
|
321
324
|
end
|
322
325
|
|
323
326
|
if rerun_failed_examples
|
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.3.
|
8
|
+
s.version = "0.3.35"
|
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: 85
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 35
|
10
|
+
version: 0.3.35
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jake Sorce, Bryan Madsen, Shawn Meredith
|