parallel_tests 2.13.0 → 2.14.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/Readme.md +1 -0
- data/lib/parallel_tests/rspec/failures_logger.rb +4 -30
- data/lib/parallel_tests/rspec/logger_base.rb +4 -14
- data/lib/parallel_tests/rspec/runner.rb +2 -14
- data/lib/parallel_tests/rspec/runtime_logger.rb +13 -26
- data/lib/parallel_tests/rspec/summary_logger.rb +4 -11
- data/lib/parallel_tests/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: f326996fc88803c4f76b9e184aa5bf2c1150e4d4
|
4
|
+
data.tar.gz: a4aa419cef3d0af3cc401082bd462028b8fbd825
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b81bfb8d8ddeb59c8383b1e5eda35ff3cddb0923d66efb38d548076d3629b7b1558029de0b8a28b27a6c071a788b56dd3d9655f1bcb44b11d4ce73c05f4263dc
|
7
|
+
data.tar.gz: d8598855d1e18ee95dad3540ef49015da0ce51836a7e3f90e904d7274993ac7c4c1bb3aeaa000a46af8e4d0f383874ded46a0466dfbbf1e648743eb5ee5d077f
|
data/Readme.md
CHANGED
@@ -359,6 +359,7 @@ inspired by [pivotal labs](https://blog.pivotal.io/labs/labs/parallelize-your-rs
|
|
359
359
|
- [Rhett Sutphin](https://github.com/rsutphin)
|
360
360
|
- [Doc Ritezel](https://github.com/ohrite)
|
361
361
|
- [Alexandre Wilhelm](https://github.com/dogild)
|
362
|
+
- [Jerry](https://github.com/boblington)
|
362
363
|
|
363
364
|
|
364
365
|
[Michael Grosser](http://grosser.it)<br/>
|
@@ -2,20 +2,7 @@ require 'parallel_tests/rspec/logger_base'
|
|
2
2
|
require 'parallel_tests/rspec/runner'
|
3
3
|
|
4
4
|
class ParallelTests::RSpec::FailuresLogger < ParallelTests::RSpec::LoggerBase
|
5
|
-
if
|
6
|
-
# RSpec 1: does not keep track of failures, so we do
|
7
|
-
def example_failed(example, *args)
|
8
|
-
if RSPEC_1
|
9
|
-
@failed_examples ||= []
|
10
|
-
@failed_examples << example
|
11
|
-
else
|
12
|
-
super
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def dump_failure(*args)
|
17
|
-
end
|
18
|
-
elsif RSPEC_2
|
5
|
+
if RSPEC_2
|
19
6
|
def dump_failures(*args)
|
20
7
|
end
|
21
8
|
else
|
@@ -24,29 +11,16 @@ class ParallelTests::RSpec::FailuresLogger < ParallelTests::RSpec::LoggerBase
|
|
24
11
|
|
25
12
|
def dump_summary(*args)
|
26
13
|
lock_output do
|
27
|
-
if
|
28
|
-
|
29
|
-
|
14
|
+
if RSPEC_2
|
15
|
+
dump_commands_to_rerun_failed_examples
|
16
|
+
else
|
30
17
|
notification = args.first
|
31
18
|
unless notification.failed_examples.empty?
|
32
19
|
colorizer = ::RSpec::Core::Formatters::ConsoleCodes
|
33
20
|
output.puts notification.colorized_rerun_commands(colorizer)
|
34
21
|
end
|
35
|
-
else
|
36
|
-
dump_commands_to_rerun_failed_examples
|
37
22
|
end
|
38
23
|
end
|
39
24
|
@output.flush
|
40
25
|
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
def dump_commands_to_rerun_failed_examples_rspec_1
|
45
|
-
(@failed_examples||[]).each do |example|
|
46
|
-
file, line = example.location.to_s.split(':')
|
47
|
-
next unless file and line
|
48
|
-
file.gsub!(%r(^.*?/spec/), './spec/')
|
49
|
-
@output.puts "#{ParallelTests::RSpec::Runner.send(:executable)} #{file}:#{line} # #{example.description}"
|
50
|
-
end
|
51
|
-
end
|
52
26
|
end
|
@@ -3,25 +3,15 @@ module ParallelTests
|
|
3
3
|
end
|
4
4
|
end
|
5
5
|
|
6
|
-
|
7
|
-
require 'rspec/core/formatters/base_text_formatter'
|
8
|
-
base = RSpec::Core::Formatters::BaseTextFormatter
|
9
|
-
rescue LoadError
|
10
|
-
require 'spec/runner/formatter/base_text_formatter'
|
11
|
-
base = Spec::Runner::Formatter::BaseTextFormatter
|
12
|
-
end
|
13
|
-
|
14
|
-
ParallelTests::RSpec::LoggerBaseBase = base
|
6
|
+
require 'rspec/core/formatters/base_text_formatter'
|
15
7
|
|
16
|
-
class ParallelTests::RSpec::LoggerBase <
|
17
|
-
|
18
|
-
RSPEC_2 = !RSPEC_1 && RSpec::Core::Version::STRING.start_with?('2')
|
19
|
-
RSPEC_3 = !RSPEC_1 && RSpec::Core::Version::STRING.start_with?('3')
|
8
|
+
class ParallelTests::RSpec::LoggerBase < RSpec::Core::Formatters::BaseTextFormatter
|
9
|
+
RSPEC_2 = RSpec::Core::Version::STRING.start_with?('2')
|
20
10
|
|
21
11
|
def initialize(*args)
|
22
12
|
super
|
23
13
|
|
24
|
-
@output ||= args[
|
14
|
+
@output ||= args[0]
|
25
15
|
|
26
16
|
if String === @output # a path ?
|
27
17
|
FileUtils.mkdir_p(File.dirname(@output))
|
@@ -9,9 +9,7 @@ module ParallelTests
|
|
9
9
|
class << self
|
10
10
|
def run_tests(test_files, process_number, num_processes, options)
|
11
11
|
exe = executable # expensive, so we cache
|
12
|
-
|
13
|
-
cmd = [exe, options[:test_options], (rspec_2_color if version == 2), spec_opts, *test_files].compact.join(" ")
|
14
|
-
options = options.merge(:env => rspec_1_color) if version == 1
|
12
|
+
cmd = [exe, options[:test_options], color, spec_opts, *test_files].compact.join(" ")
|
15
13
|
execute_command(cmd, process_number, num_processes, options)
|
16
14
|
end
|
17
15
|
|
@@ -19,8 +17,6 @@ module ParallelTests
|
|
19
17
|
cmd = case
|
20
18
|
when File.exist?("bin/rspec")
|
21
19
|
WINDOWS ? "ruby bin/rspec" : "bin/rspec"
|
22
|
-
when File.file?("script/spec")
|
23
|
-
"script/spec"
|
24
20
|
when ParallelTests.bundler_enabled?
|
25
21
|
cmd = (run("bundle show rspec-core") =~ %r{Could not find gem.*} ? "spec" : "rspec")
|
26
22
|
"bundle exec #{cmd}"
|
@@ -65,15 +61,7 @@ module ParallelTests
|
|
65
61
|
`#{cmd}`
|
66
62
|
end
|
67
63
|
|
68
|
-
def
|
69
|
-
if $stdout.tty?
|
70
|
-
{'RSPEC_COLOR' => "1"}
|
71
|
-
else
|
72
|
-
{}
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def rspec_2_color
|
64
|
+
def color
|
77
65
|
'--color --tty' if $stdout.tty?
|
78
66
|
end
|
79
67
|
|
@@ -5,39 +5,26 @@ class ParallelTests::RSpec::RuntimeLogger < ParallelTests::RSpec::LoggerBase
|
|
5
5
|
def initialize(*args)
|
6
6
|
super
|
7
7
|
@example_times = Hash.new(0)
|
8
|
-
@group_nesting = 0
|
8
|
+
@group_nesting = 0
|
9
9
|
end
|
10
10
|
|
11
|
-
|
11
|
+
unless RSPEC_2
|
12
12
|
RSpec::Core::Formatters.register self, :example_group_started, :example_group_finished, :start_dump
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
def example_passed(example)
|
22
|
-
file = example.location.split(':').first
|
23
|
-
@example_times[file] += ParallelTests.now - @time
|
24
|
-
super
|
25
|
-
end
|
26
|
-
else
|
27
|
-
def example_group_started(example_group)
|
28
|
-
@time = ParallelTests.now if @group_nesting == 0
|
29
|
-
@group_nesting += 1
|
30
|
-
super
|
31
|
-
end
|
15
|
+
def example_group_started(example_group)
|
16
|
+
@time = ParallelTests.now if @group_nesting == 0
|
17
|
+
@group_nesting += 1
|
18
|
+
super
|
19
|
+
end
|
32
20
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
39
|
-
super if defined?(super)
|
21
|
+
def example_group_finished(notification)
|
22
|
+
@group_nesting -= 1
|
23
|
+
if @group_nesting == 0
|
24
|
+
path = (RSPEC_2 ? notification.file_path : notification.group.file_path)
|
25
|
+
@example_times[path] += ParallelTests.now - @time
|
40
26
|
end
|
27
|
+
super if defined?(super)
|
41
28
|
end
|
42
29
|
|
43
30
|
def dump_summary(*args);end
|
@@ -1,19 +1,12 @@
|
|
1
1
|
require 'parallel_tests/rspec/failures_logger'
|
2
2
|
|
3
3
|
class ParallelTests::RSpec::SummaryLogger < ParallelTests::RSpec::LoggerBase
|
4
|
-
|
4
|
+
unless RSPEC_2
|
5
5
|
RSpec::Core::Formatters.register self, :dump_failures
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
@output.flush
|
12
|
-
end
|
13
|
-
else
|
14
|
-
def dump_failures(*args)
|
15
|
-
lock_output { super }
|
16
|
-
@output.flush
|
17
|
-
end
|
8
|
+
def dump_failures(*args)
|
9
|
+
lock_output { super }
|
10
|
+
@output.flush
|
18
11
|
end
|
19
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_tests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|