rspec-multiprocess_runner 0.2.3 → 0.3.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/exe/multirspec +1 -6
- data/lib/rspec/multiprocess_runner/command_line_options.rb +3 -3
- data/lib/rspec/multiprocess_runner/coordinator.rb +8 -14
- data/lib/rspec/multiprocess_runner/rake_task.rb +3 -1
- data/lib/rspec/multiprocess_runner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d891049e0122f0b95c00eab92191c798e68d533
|
4
|
+
data.tar.gz: 7ddbae3e691ed2ab6d2121e7a362ea61a279e680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8fe6572977652575bb0d8073222f65a0cd0b1c696b2ee2ce51bd9e2d6133d4c749610c094956f7f1c27e0b3942a3297858563f2c86d30d6c412f3f196f358b4
|
7
|
+
data.tar.gz: def29fc93cb9a4e822bf08c7f16a923d701b2b74959625db36933001abce6000e3fd8f6e3930f1d5b4dd0bf8b57e8e99a9af5dd9716abf11566b1dfc4d789ccb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
+
# 0.3.0
|
2
|
+
|
3
|
+
* Require a filename for the `--log-failing-files` option (#9)
|
4
|
+
* Exit status for `multirspec` is only 0 on success and is always non-zero when
|
5
|
+
there is any sort of failure (#8)
|
6
|
+
|
1
7
|
# 0.2.3
|
2
8
|
|
9
|
+
* Add `--log-failing-files` option (#7)
|
3
10
|
|
4
11
|
# 0.2.2
|
5
12
|
|
data/exe/multirspec
CHANGED
@@ -13,7 +13,7 @@ module RSpec::MultiprocessRunner
|
|
13
13
|
self.file_timeout_seconds = nil
|
14
14
|
self.example_timeout_seconds = 15
|
15
15
|
self.pattern = "**/*_spec.rb"
|
16
|
-
self.log_failing_files =
|
16
|
+
self.log_failing_files = nil
|
17
17
|
self.rspec_options = []
|
18
18
|
end
|
19
19
|
|
@@ -88,8 +88,8 @@ module RSpec::MultiprocessRunner
|
|
88
88
|
self.pattern = pattern
|
89
89
|
end
|
90
90
|
|
91
|
-
parser.on("--log-failing-files", "
|
92
|
-
self.log_failing_files =
|
91
|
+
parser.on("--log-failing-files FILENAME", "Filename to log failing files to") do |filename|
|
92
|
+
self.log_failing_files = filename
|
93
93
|
end
|
94
94
|
|
95
95
|
parser.on_tail("-h", "--help", "Prints this help") do
|
@@ -175,7 +175,6 @@ module RSpec::MultiprocessRunner
|
|
175
175
|
by_status_and_time = combine_example_results.each_with_object({}) do |result, idx|
|
176
176
|
(idx[result.status] ||= []) << result
|
177
177
|
end
|
178
|
-
count_examples(by_status_and_time)
|
179
178
|
|
180
179
|
print_skipped_files_details
|
181
180
|
print_pending_example_details(by_status_and_time["pending"])
|
@@ -196,13 +195,6 @@ module RSpec::MultiprocessRunner
|
|
196
195
|
(@workers + @stopped_workers).detect { |w| w.example_results.detect { |r| r.status == "failed" } }
|
197
196
|
end
|
198
197
|
|
199
|
-
def count_examples(example_results)
|
200
|
-
@metadata = {}
|
201
|
-
@metadata[:example_count] = example_results.map { |status, results| results.size }.inject(0) { |sum, ct| sum + ct }
|
202
|
-
@metadata[:failure_count] = example_results["failed"] ? example_results["failed"].size : 0
|
203
|
-
@metadata[:pending_count] = example_results["pending"] ? example_results["pending"].size : 0
|
204
|
-
end
|
205
|
-
|
206
198
|
def print_skipped_files_details
|
207
199
|
return if @spec_files.empty?
|
208
200
|
puts
|
@@ -235,7 +227,6 @@ module RSpec::MultiprocessRunner
|
|
235
227
|
|
236
228
|
def log_failed_files(failed_example_results)
|
237
229
|
return if failed_example_results.nil?
|
238
|
-
return if failed_example_results.size > @metadata[:example_count] / 10.0
|
239
230
|
|
240
231
|
failing_files = Hash.new { |h, k| h[k] = 0 }
|
241
232
|
failed_example_results.each do |failure|
|
@@ -243,8 +234,8 @@ module RSpec::MultiprocessRunner
|
|
243
234
|
end
|
244
235
|
|
245
236
|
puts
|
246
|
-
puts "Writing failures to file:
|
247
|
-
File.open(
|
237
|
+
puts "Writing failures to file: #{@log_failing_files}"
|
238
|
+
File.open(@log_failing_files, "w+") do |io|
|
248
239
|
failing_files.each do |(k, _)|
|
249
240
|
io << k
|
250
241
|
io << "\n"
|
@@ -258,13 +249,16 @@ module RSpec::MultiprocessRunner
|
|
258
249
|
end
|
259
250
|
|
260
251
|
def print_example_counts(by_status_and_time)
|
252
|
+
example_count = by_status_and_time.map { |status, results| results.size }.inject(0) { |sum, ct| sum + ct }
|
253
|
+
failure_count = by_status_and_time["failed"] ? by_status_and_time["failed"].size : 0
|
254
|
+
pending_count = by_status_and_time["pending"] ? by_status_and_time["pending"].size : 0
|
261
255
|
process_failure_count = failed_workers.size
|
262
256
|
skipped_count = @spec_files.size
|
263
257
|
|
264
258
|
# Copied from RSpec
|
265
|
-
summary = pluralize(
|
266
|
-
summary << ", " << pluralize(
|
267
|
-
summary << ", #{
|
259
|
+
summary = pluralize(example_count, "example")
|
260
|
+
summary << ", " << pluralize(failure_count, "failure")
|
261
|
+
summary << ", #{pending_count} pending" if pending_count > 0
|
268
262
|
summary << ", " << pluralize(process_failure_count, "failed proc") if process_failure_count > 0
|
269
263
|
summary << ", " << pluralize(skipped_count, "skipped file") if skipped_count > 0
|
270
264
|
puts summary
|
@@ -52,6 +52,8 @@ module RSpec::MultiprocessRunner
|
|
52
52
|
# rspec binary from the loaded rspec-core gem.
|
53
53
|
attr_accessor :multirspec_path
|
54
54
|
|
55
|
+
# Filename to which to append a list of the files containing specs that
|
56
|
+
# failed.
|
55
57
|
attr_accessor :log_failing_files
|
56
58
|
|
57
59
|
# Command line options to pass to the RSpec workers. Defaults to `nil`.
|
@@ -110,7 +112,7 @@ module RSpec::MultiprocessRunner
|
|
110
112
|
cmd_parts << '--pattern' << pattern
|
111
113
|
end
|
112
114
|
if log_failing_files
|
113
|
-
cmd_parts << '--log-failing-files'
|
115
|
+
cmd_parts << '--log-failing-files' << log_failing_files
|
114
116
|
end
|
115
117
|
if files_or_directories
|
116
118
|
cmd_parts.concat(files_or_directories)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-multiprocess_runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rhett Sutphin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-core
|