parallel_tests 0.16.17 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/Readme.md +1 -3
- data/lib/parallel_tests/rspec/failures_logger.rb +16 -6
- data/lib/parallel_tests/rspec/logger_base.rb +4 -1
- data/lib/parallel_tests/rspec/runtime_logger.rb +9 -4
- data/lib/parallel_tests/rspec/summary_logger.rb +11 -11
- data/lib/parallel_tests/version.rb +1 -1
- data/spec/parallel_tests/rspec/runtime_logger_spec.rb +6 -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: d87fe66d8f59d1f365394d2e81e038638220c891
|
4
|
+
data.tar.gz: ffbb3e8e45357f998107b623cad4b3f25b6e859f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 792175a098da834f91641fdbdb2898c6d6944703fe7ca12ee4e6b103b948582c4d24aac09ad4e45981e8dbeedcb30012d365667e0c9691016b601bbcb9756e80
|
7
|
+
data.tar.gz: c3d9d360e4adf512a569ae390faae2bec9dfabe4e8ffd45e46c7f05e882a5afbd6dfac18579b85a701368085234d0035ca0b7a9d55776f59c44819ae114ff711
|
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -99,7 +99,6 @@ so that each process should finish around the same time.
|
|
99
99
|
|
100
100
|
Rspec: Add to your `.rspec_parallel` (or `.rspec`) :
|
101
101
|
|
102
|
-
If installed as plugin: -I vendor/plugins/parallel_tests/lib
|
103
102
|
--format progress
|
104
103
|
--format ParallelTests::RSpec::RuntimeLogger --out tmp/parallel_runtime_rspec.log
|
105
104
|
|
@@ -115,7 +114,6 @@ This logger logs the test output without the different processes overwriting eac
|
|
115
114
|
|
116
115
|
Add the following to your `.rspec_parallel` (or `.rspec`) :
|
117
116
|
|
118
|
-
If installed as plugin: -I vendor/plugins/parallel_tests/lib
|
119
117
|
--format progress
|
120
118
|
--format ParallelTests::RSpec::SummaryLogger --out tmp/spec_summary.log
|
121
119
|
|
@@ -130,7 +128,6 @@ E.g.
|
|
130
128
|
|
131
129
|
Add the following to your `.rspec_parallel` (or `.rspec`) :
|
132
130
|
|
133
|
-
If installed as plugin: -I vendor/plugins/parallel_tests/lib
|
134
131
|
--format progress
|
135
132
|
--format ParallelTests::RSpec::FailuresLogger --out tmp/failing_specs.log
|
136
133
|
|
@@ -297,6 +294,7 @@ inspired by [pivotal labs](http://pivotallabs.com/users/miked/blog/articles/849-
|
|
297
294
|
- [Brandon Turner](https://github.com/blt04)
|
298
295
|
- [Matt Hodgson](https://github.com/mhodgson)
|
299
296
|
- [bicarbon8](https://github.com/bicarbon8)
|
297
|
+
- [seichner](https://github.com/seichner)
|
300
298
|
|
301
299
|
[Michael Grosser](http://grosser.it)<br/>
|
302
300
|
michael@grosser.it<br/>
|
@@ -2,6 +2,10 @@ 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 RSPEC_3
|
6
|
+
RSpec::Core::Formatters.register self, :dump_failures, :dump_summary
|
7
|
+
end
|
8
|
+
|
5
9
|
# RSpec 1: does not keep track of failures, so we do
|
6
10
|
def example_failed(example, *args)
|
7
11
|
if RSPEC_1
|
@@ -12,18 +16,24 @@ class ParallelTests::RSpec::FailuresLogger < ParallelTests::RSpec::LoggerBase
|
|
12
16
|
end
|
13
17
|
end
|
14
18
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
if RSPEC_1
|
20
|
+
def dump_failure(*args)
|
21
|
+
end
|
22
|
+
else
|
23
|
+
def dump_failures(*args)
|
24
|
+
end
|
21
25
|
end
|
22
26
|
|
23
27
|
def dump_summary(*args)
|
24
28
|
lock_output do
|
25
29
|
if RSPEC_1
|
26
30
|
dump_commands_to_rerun_failed_examples_rspec_1
|
31
|
+
elsif RSPEC_3
|
32
|
+
notification = args.first
|
33
|
+
unless notification.failed_examples.empty?
|
34
|
+
colorizer = ::RSpec::Core::Formatters::ConsoleCodes
|
35
|
+
output.puts notification.colorized_rerun_commands(colorizer)
|
36
|
+
end
|
27
37
|
else
|
28
38
|
dump_commands_to_rerun_failed_examples
|
29
39
|
end
|
@@ -15,6 +15,7 @@ ParallelTests::RSpec::LoggerBaseBase = base
|
|
15
15
|
|
16
16
|
class ParallelTests::RSpec::LoggerBase < ParallelTests::RSpec::LoggerBaseBase
|
17
17
|
RSPEC_1 = !defined?(RSpec::Core::Formatters::BaseTextFormatter) # do not test for Spec, this will trigger deprecation warning in rspec 2
|
18
|
+
RSPEC_3 = !RSPEC_1 && RSpec::Core::Version::STRING.start_with?('3')
|
18
19
|
|
19
20
|
def initialize(*args)
|
20
21
|
super
|
@@ -31,8 +32,10 @@ class ParallelTests::RSpec::LoggerBase < ParallelTests::RSpec::LoggerBaseBase
|
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
35
|
+
protected
|
36
|
+
|
34
37
|
#stolen from Rspec
|
35
|
-
def close
|
38
|
+
def close(*args)
|
36
39
|
@output.close if (IO === @output) & (@output != $stdout)
|
37
40
|
end
|
38
41
|
|
@@ -5,7 +5,11 @@ 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 unless RSPEC_1
|
9
|
+
end
|
10
|
+
|
11
|
+
if RSPEC_3
|
12
|
+
RSpec::Core::Formatters.register self, :example_group_started, :example_group_finished, :start_dump
|
9
13
|
end
|
10
14
|
|
11
15
|
if RSPEC_1
|
@@ -26,12 +30,13 @@ class ParallelTests::RSpec::RuntimeLogger < ParallelTests::RSpec::LoggerBase
|
|
26
30
|
super
|
27
31
|
end
|
28
32
|
|
29
|
-
def example_group_finished(
|
33
|
+
def example_group_finished(notification)
|
30
34
|
@group_nesting -= 1
|
31
35
|
if @group_nesting == 0
|
32
|
-
|
36
|
+
path = (RSPEC_3 ? notification.group.file_path : notification.file_path)
|
37
|
+
@example_times[path] += ParallelTests.now - @time
|
33
38
|
end
|
34
|
-
super
|
39
|
+
super if defined?(super)
|
35
40
|
end
|
36
41
|
end
|
37
42
|
|
@@ -1,19 +1,19 @@
|
|
1
1
|
require 'parallel_tests/rspec/failures_logger'
|
2
2
|
|
3
3
|
class ParallelTests::RSpec::SummaryLogger < ParallelTests::RSpec::LoggerBase
|
4
|
-
|
5
|
-
|
6
|
-
lock_output do
|
7
|
-
super
|
8
|
-
end
|
9
|
-
@output.flush
|
4
|
+
if RSPEC_3
|
5
|
+
RSpec::Core::Formatters.register self, :dump_failures
|
10
6
|
end
|
11
7
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
8
|
+
if RSPEC_1
|
9
|
+
def dump_failure(*args)
|
10
|
+
lock_output { super }
|
11
|
+
@output.flush
|
12
|
+
end
|
13
|
+
else
|
14
|
+
def dump_failures(*args)
|
15
|
+
lock_output { super }
|
16
|
+
@output.flush
|
16
17
|
end
|
17
|
-
@output.flush
|
18
18
|
end
|
19
19
|
end
|
@@ -21,9 +21,14 @@ describe ParallelTests::RSpec::RuntimeLogger do
|
|
21
21
|
ParallelTests::RSpec::RuntimeLogger.new(f)
|
22
22
|
end
|
23
23
|
|
24
|
-
example = (
|
24
|
+
example = double(:file_path => "#{Dir.pwd}/spec/foo.rb")
|
25
|
+
if ParallelTests::RSpec::RuntimeLogger::RSPEC_3
|
26
|
+
example = double(:group => example)
|
27
|
+
end
|
28
|
+
|
25
29
|
logger.example_group_started example
|
26
30
|
logger.example_group_finished example
|
31
|
+
|
27
32
|
logger.start_dump
|
28
33
|
|
29
34
|
#f.close
|
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: 0.
|
4
|
+
version: 1.0.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: 2014-06-
|
11
|
+
date: 2014-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|