parallelized_specs 0.4.34 → 0.4.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 +30 -0
- 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.4.
|
15
|
+
gem.version = "0.4.35"
|
16
16
|
end
|
17
17
|
Jeweler::GemcutterTasks.new
|
18
18
|
rescue LoadError
|
data/lib/parallelized_specs.rb
CHANGED
@@ -107,6 +107,8 @@ 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
|
+
|
110
112
|
#parse and print results
|
111
113
|
results = find_results(test_results.map { |result| result[:stdout] }*"")
|
112
114
|
#puts ""
|
@@ -469,5 +471,33 @@ class ParallelizedSpecs
|
|
469
471
|
runtime_setup
|
470
472
|
start_reruns
|
471
473
|
end
|
474
|
+
|
475
|
+
def self.slowest_spec_determination(file)
|
476
|
+
if File.exists?(file)
|
477
|
+
spec_durations = []
|
478
|
+
File.open(file).each_line do |line|
|
479
|
+
spec_durations << line
|
480
|
+
end
|
481
|
+
File.open(file, 'w') { |f| f.truncate(0) }
|
482
|
+
populate_slowest_specs(spec_durations, file)
|
483
|
+
else
|
484
|
+
puts "slow spec profiling was not enabled"
|
485
|
+
end
|
486
|
+
end
|
487
|
+
|
488
|
+
def self.populate_slowest_specs(spec_durations, file)
|
489
|
+
slowest_specs = []
|
490
|
+
spec_durations.each do |spec|
|
491
|
+
time = spec.match(/.*\d/).to_s
|
492
|
+
if time.to_f >= 30
|
493
|
+
slowest_specs << spec
|
494
|
+
end
|
495
|
+
end
|
496
|
+
slowest_specs.each do |slow_spec|
|
497
|
+
File.open(file, 'a+') { |f| f.puts slow_spec }
|
498
|
+
end
|
499
|
+
end
|
472
500
|
end
|
473
501
|
|
502
|
+
|
503
|
+
|
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.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: 73
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 35
|
10
|
+
version: 0.4.35
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jake Sorce, Bryan Madsen, Shawn Meredith
|