parallelized_specs 0.4.52 → 0.4.53
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 +5 -6
- data/lib/parallelized_specs/spec_start_finish_logger.rb +13 -7
- data/parallelized_specs.gemspec +2 -2
- metadata +4 -4
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.53"
|
16
16
|
end
|
17
17
|
Jeweler::GemcutterTasks.new
|
18
18
|
rescue LoadError
|
data/lib/parallelized_specs.rb
CHANGED
@@ -116,8 +116,7 @@ class ParallelizedSpecs
|
|
116
116
|
|
117
117
|
results = find_results(test_results.map { |result| result[:stdout] }*"")
|
118
118
|
|
119
|
-
|
120
|
-
if @outcome_builder_enabled
|
119
|
+
if @outcome_builder_enabled
|
121
120
|
puts "INFO: OutcomeBuilder is enabled now checking for false positives"
|
122
121
|
@total_specs, @total_failures, @total_pending = calculate_total_spec_details
|
123
122
|
puts "INFO: Total specs run #{@total_specs} failed specs #{@total_failures} pending specs #{@total_pending}\n INFO: Took #{Time.now - start} seconds"
|
@@ -160,7 +159,7 @@ class ParallelizedSpecs
|
|
160
159
|
def self.formatter_directory_management(formatters)
|
161
160
|
FileUtils.mkdir_p('parallel_log') if !File.directory?('tmp/parallel_log')
|
162
161
|
begin
|
163
|
-
%w['tmp/parallel_log/spec_count','tmp/parallel_log/failed_specs', 'tmp/parallel_log/thread_started'].each do |dir|
|
162
|
+
%w['tmp/parallel_log/spec_count','tmp/parallel_log/failed_specs', 'tmp/parallel_log/thread_started', 'tmp/parallel_log/total_specs.txt'].each do |dir|
|
164
163
|
directory_cleanup_and_create(dir)
|
165
164
|
end
|
166
165
|
rescue SystemCallError
|
@@ -202,12 +201,12 @@ class ParallelizedSpecs
|
|
202
201
|
threads.each do |t|
|
203
202
|
failed_thread = t.match(/\d/).to_s
|
204
203
|
if failed_thread == "1"
|
205
|
-
puts "INFO: Thread 1 last spec to start running"
|
206
204
|
last_spec = IO.readlines("#{Rails.root}/tmp/parallel_log/thread_.log")[-1]
|
205
|
+
puts "INFO: Thread 1 last spec to start running \n #{last_spec}"
|
207
206
|
File.open("#{Rails.root}/tmp/parallel_log/error.log", 'a+') { |f| f.write "\n\n\n\nrspec thread #{failed_thread} failed to complete\n the last spec to try to run was #{last_spec}" }
|
208
207
|
else
|
209
|
-
puts "INFO: Thread #{failed_thread} last spec to start running"
|
210
208
|
last_spec = IO.readlines("#{Rails.root}/tmp/parallel_log/thread_#{failed_thread}.log")[-1]
|
209
|
+
puts "INFO: Thread #{failed_thread} last spec to start running \n #{last_spec}"
|
211
210
|
File.open("#{Rails.root}/tmp/parallel_log/error.log", 'a+') { |f| f.write "\n\n\n\nrspec thread #{failed_thread} failed to complete\n the last spec to try to run was #{last_spec}" }
|
212
211
|
end
|
213
212
|
end
|
@@ -367,7 +366,7 @@ class ParallelizedSpecs
|
|
367
366
|
def self.parse_result(result)
|
368
367
|
puts "INFO: this is the result\n#{result}"
|
369
368
|
#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
|
370
|
-
rerun_status = result.
|
369
|
+
rerun_status = result.match(/(\d) example, (\d) failure/).to_a
|
371
370
|
puts "INFO: this is the rerun_status\n#{rerun_status}"
|
372
371
|
@examples = rerun_status[-2].to_i
|
373
372
|
@failures = rerun_status.last.to_i
|
@@ -8,7 +8,7 @@ class ParallelizedSpecs::SpecStartFinishLogger < ParallelizedSpecs::SpecLoggerBa
|
|
8
8
|
output = "#{output}_#{ENV['TEST_ENV_NUMBER']}.log"
|
9
9
|
if String === output
|
10
10
|
FileUtils.mkdir_p(File.dirname(output))
|
11
|
-
File.open(output, 'w'){} # overwrite previous results
|
11
|
+
File.open(output, 'w') {} # overwrite previous results
|
12
12
|
@output = File.open(output, 'a')
|
13
13
|
elsif File === output
|
14
14
|
output.close # close file opened with 'w'
|
@@ -19,20 +19,26 @@ class ParallelizedSpecs::SpecStartFinishLogger < ParallelizedSpecs::SpecLoggerBa
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def example_started(example)
|
22
|
-
|
23
|
-
|
22
|
+
lock_output do
|
23
|
+
@output.puts "\nstarted spec: #{example.description}"
|
24
|
+
end
|
24
25
|
end
|
25
26
|
|
26
27
|
def example_passed(example)
|
27
|
-
|
28
|
+
lock_output do
|
29
|
+
@output.puts "finished spec: #{example.description}"
|
30
|
+
end
|
28
31
|
end
|
29
32
|
|
30
33
|
def example_pending(example, message)
|
31
|
-
|
34
|
+
lock_output do
|
35
|
+
@output.puts "finished spec: #{example.description}"
|
36
|
+
end
|
32
37
|
end
|
33
38
|
|
34
39
|
def example_failed(example, count, failure)
|
35
|
-
|
40
|
+
lock_output do
|
41
|
+
@output.puts "finished spec: #{example.description}"
|
42
|
+
end
|
36
43
|
end
|
37
|
-
|
38
44
|
end
|
data/parallelized_specs.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
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.53"
|
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"]
|
12
|
-
s.date = "2013-04-
|
12
|
+
s.date = "2013-04-24"
|
13
13
|
s.email = "jake@instructure.com"
|
14
14
|
s.files = [
|
15
15
|
"Gemfile",
|
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: 101
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 53
|
10
|
+
version: 0.4.53
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jake Sorce, Bryan Madsen, Shawn Meredith
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-04-
|
18
|
+
date: 2013-04-24 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: parallel
|