parallelized_specs 0.4.33 → 0.4.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.33"
15
+ gem.version = "0.4.34"
16
16
  end
17
17
  Jeweler::GemcutterTasks.new
18
18
  rescue LoadError
@@ -9,7 +9,7 @@ require 'parallelized_specs/outcome_builder'
9
9
  require 'parallelized_specs/example_failures_logger'
10
10
  require 'parallelized_specs/trending_example_failures_logger'
11
11
  require 'parallelized_specs/failures_rerun_logger'
12
- require 'parallelized_specs/slowest_spec_logger'
12
+
13
13
 
14
14
  class ParallelizedSpecs
15
15
  VERSION = File.read(File.join(File.dirname(__FILE__), '..', 'VERSION')).strip
@@ -107,8 +107,6 @@ class ParallelizedSpecs
107
107
  run_tests(group, groups.index(group), options)
108
108
  end
109
109
 
110
- slowest_spec_determination("#{RAILS_ROOT}/tmp/parallel_log/slowest_specs.log")
111
-
112
110
  #parse and print results
113
111
  results = find_results(test_results.map { |result| result[:stdout] }*"")
114
112
  #puts ""
@@ -152,32 +150,6 @@ class ParallelizedSpecs
152
150
  puts "INFO: marking build as PASSED"
153
151
  end
154
152
 
155
- def self.slowest_spec_determination(file)
156
- if File.exists?(file)
157
- spec_durations = []
158
- File.open(file).each_line do |line|
159
- spec_durations << line
160
- end
161
- File.open(file, 'w') { |f| f.truncate(0) }
162
- populate_slowest_specs(spec_durations, file)
163
- else
164
- puts "slow spec profiling was not enabled"
165
- end
166
- end
167
-
168
- def self.populate_slowest_specs(spec_durations, file)
169
- slowest_specs = []
170
- spec_durations.each do |spec|
171
- time = spec.match(/.*\d/).to_s
172
- if time.to_f >= 30
173
- slowest_specs << spec
174
- end
175
- end
176
- slowest_specs.each do |slow_spec|
177
- File.open(file, 'a+') { |f| f.puts slow_spec }
178
- end
179
- end
180
-
181
153
  # parallel:spec[:count, :pattern, :options]
182
154
  def self.parse_rake_args(args)
183
155
  # order as given by user
@@ -330,7 +302,8 @@ class ParallelizedSpecs
330
302
  #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
331
303
  rerun_status = result.scan(/\d*[^\D]\d*/).to_a
332
304
  puts "INFO: this is the rerun_status\n#{rerun_status}"
333
- @examples = rerun_status[-2].to_i
305
+ example_index = rerun_status.length - 2
306
+ @examples = rerun_status[example_index].to_i
334
307
  @failures = rerun_status.last.to_i
335
308
  end
336
309
 
@@ -373,7 +346,7 @@ class ParallelizedSpecs
373
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"
374
347
  when code == 6
375
348
  print_failures("#{RAILS_ROOT}/tmp/parallel_log/error.log")
376
- 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}"
349
+ abort "SEVERE: #{@error_count} errors are to many to rerun, marking the build as a failure"
377
350
  when code == 7
378
351
  puts "#Total errors #{@error_count}"
379
352
  abort "SEVERE: unexpected error information, please check errors are being written to file correctly"
@@ -408,16 +381,15 @@ class ParallelizedSpecs
408
381
  @error_count = %x{wc -l "#{@filename}"}.match(/\d*[^\D]/).to_s #counts the number of lines in the file
409
382
  @error_count = @error_count.to_i
410
383
  puts "INFO: error count = #@error_count"
411
- ENV["RERUNS"] != nil ? @max_reruns = ENV["RERUNS"].to_i : @max_reruns = 9
412
384
 
413
- if !@error_count.between?(1, @max_reruns)
385
+ if !@error_count.between?(1, 9)
414
386
  puts "INFO: total errors are not in rerun eligibility range"
415
387
  case
416
388
  when @error_count == 0
417
389
  puts "INFO: 0 errors build being aborted"
418
390
  abort_reruns(5)
419
- when @error_count > @max_reruns
420
- puts "INFO: error count has exceeded maximum errors of #{@max_reruns}"
391
+ when @error_count > 9
392
+ puts "INFO: error count has exceeded maximum errors of 9"
421
393
  abort_reruns(6)
422
394
  else
423
395
  abort_reruns(7)
@@ -476,6 +448,7 @@ class ParallelizedSpecs
476
448
 
477
449
 
478
450
  def self.determine_rerun_outcome
451
+
479
452
  if @rerun_failures.count > 0
480
453
  abort_reruns(8)
481
454
  elsif @rerun_passes.count >= @error_count
@@ -1 +1 @@
1
- require File.join(File.dirname(__FILE__), "/../parallelized_specs/tasks")
1
+ require File.join(File.dirname(__FILE__), "/../parallelized_specs/tasks")
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "parallelized_specs"
8
- s.version = "0.4.33"
8
+ s.version = "0.4.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: 77
4
+ hash: 75
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 33
10
- version: 0.4.33
9
+ - 34
10
+ version: 0.4.34
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jake Sorce, Bryan Madsen, Shawn Meredith