parallelized_specs 0.4.36 → 0.4.37
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 +3 -0
- data/parallelized_specs.gemspec +1 -2
- metadata +3 -4
- data/lib/parallelized_specs/slow_spec_logger.rb +0 -34
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.37"
|
16
16
|
end
|
17
17
|
Jeweler::GemcutterTasks.new
|
18
18
|
rescue LoadError
|
data/lib/parallelized_specs.rb
CHANGED
@@ -123,6 +123,7 @@ class ParallelizedSpecs
|
|
123
123
|
if Dir.glob("#{RAILS_ROOT}/tmp/parallel_log/spec_count/{*,.*}").count == 2 && Dir.glob("#{RAILS_ROOT}/tmp/parallel_log/thread_started/{*,.*}").count == num_processes + 2
|
124
124
|
(puts "INFO: All threads completed")
|
125
125
|
elsif Dir.glob("#{RAILS_ROOT}/tmp/parallel_log/thread_started/{*,.*}").count != num_processes + 2
|
126
|
+
File.open("#{RAILS_ROOT}/tmp/parallel_log/failure_cause.log", 'a+') { |f| f.write "Syntax errors" }
|
126
127
|
abort "SEVERE: one or more threads didn't get started by rspec, this may be caused by a syntax issue in specs, check logs right before specs start running"
|
127
128
|
else
|
128
129
|
threads = Dir["#{RAILS_ROOT}/tmp/parallel_log/spec_count/*"]
|
@@ -136,6 +137,7 @@ class ParallelizedSpecs
|
|
136
137
|
puts IO.readlines("#{RAILS_ROOT}/tmp/parallel_log/thread_#{failed_thread}.log")[-1]
|
137
138
|
end
|
138
139
|
end
|
140
|
+
File.open("#{RAILS_ROOT}/tmp/parallel_log/failure_cause.log", 'a+') { |f| f.write "rspec thread failed to complete" }
|
139
141
|
abort "SEVERE: One or more threads have failed to complete, this may be caused by a rspec runtime crashing prematurely" #works on both 1.8.7\1.9.3
|
140
142
|
end
|
141
143
|
#exit with correct status code so rake parallel:test && echo 123 works
|
@@ -354,6 +356,7 @@ class ParallelizedSpecs
|
|
354
356
|
abort "SEVERE: unexpected error information, please check errors are being written to file correctly"
|
355
357
|
when code == 8
|
356
358
|
print_failures(@failure_summary, "RERUN")
|
359
|
+
File.open("#{RAILS_ROOT}/tmp/parallel_log/failure_cause.log", 'a+') { |f| f.write @rerun_failures.count }
|
357
360
|
abort "SEVERE: some specs failed on rerun, the build will be marked as failed"
|
358
361
|
when code == 9
|
359
362
|
abort "SEVERE: unexpected situation on rerun, marking build as failure"
|
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.37"
|
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"]
|
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
|
|
24
24
|
"lib/parallelized_specs/outcome_builder.rb",
|
25
25
|
"lib/parallelized_specs/railtie.rb",
|
26
26
|
"lib/parallelized_specs/runtime_logger.rb",
|
27
|
-
"lib/parallelized_specs/slow_spec_logger.rb",
|
28
27
|
"lib/parallelized_specs/spec_error_count_logger.rb",
|
29
28
|
"lib/parallelized_specs/spec_error_logger.rb",
|
30
29
|
"lib/parallelized_specs/spec_failures_logger.rb",
|
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: 69
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 37
|
10
|
+
version: 0.4.37
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jake Sorce, Bryan Madsen, Shawn Meredith
|
@@ -52,7 +52,6 @@ files:
|
|
52
52
|
- lib/parallelized_specs/outcome_builder.rb
|
53
53
|
- lib/parallelized_specs/railtie.rb
|
54
54
|
- lib/parallelized_specs/runtime_logger.rb
|
55
|
-
- lib/parallelized_specs/slow_spec_logger.rb
|
56
55
|
- lib/parallelized_specs/spec_error_count_logger.rb
|
57
56
|
- lib/parallelized_specs/spec_error_logger.rb
|
58
57
|
- lib/parallelized_specs/spec_failures_logger.rb
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'parallelized_specs'
|
2
|
-
|
3
|
-
module RSpec
|
4
|
-
|
5
|
-
|
6
|
-
class ParallelizedSpecs::SlowestSpecLogger < ParallelizedSpecs::SpecLoggerBase
|
7
|
-
|
8
|
-
def example_started(example)
|
9
|
-
@spec_start_time = Time.now
|
10
|
-
end
|
11
|
-
|
12
|
-
def example_passed(example)
|
13
|
-
total_time = determine_spec_duration(@spec_start_time)
|
14
|
-
write_total_spec_time(total_time, example)
|
15
|
-
end
|
16
|
-
|
17
|
-
def example_failed(example, count, failure)
|
18
|
-
total_time = determine_spec_duration(@spec_start_time)
|
19
|
-
write_total_spec_time(total_time, example)
|
20
|
-
end
|
21
|
-
|
22
|
-
def determine_spec_duration(spec_start_time)
|
23
|
-
total_time = Time.now - spec_start_time
|
24
|
-
total_time
|
25
|
-
end
|
26
|
-
|
27
|
-
def write_total_spec_time(total_time, example)
|
28
|
-
lock_output do
|
29
|
-
@output.puts "#{total_time}*#{example.description}"
|
30
|
-
end
|
31
|
-
@output.flush
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|