rrrspec-client 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rrrspec/client/rspec_runner.rb +15 -17
- data/lib/rrrspec/client/slave_runner.rb +47 -25
- data/lib/rrrspec/client/version.rb +1 -1
- data/rrrspec-client.gemspec +1 -1
- metadata +4 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42b80bd79e217f92b060c1cc3ee329fc47e65d20
|
4
|
+
data.tar.gz: c81027789ac8dde9d749f2c044cb6f38c66f1659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23b32613282ccd0680fe04c98b89b22a5595e82cedc9d1c566d23aaff4450c42394f44e5ba8319cfe432aa14ae7eb3e6db6733836ad95ac4c5c3fb1ddc180632
|
7
|
+
data.tar.gz: 312c3195f17d9ea1d50a34bc80f333b6955f92c5619dc6502b881e24684a42650a18345cf881c9888998efa980b240c31656d7fd86063c2a0a3926cad4bff8ce
|
@@ -6,9 +6,7 @@ module RRRSpec
|
|
6
6
|
class RSpecRunner
|
7
7
|
def initialize
|
8
8
|
@options = RSpec::Core::ConfigurationOptions.new([])
|
9
|
-
@options.parse_options
|
10
9
|
@configuration = RSpec.configuration
|
11
|
-
@configuration.setup_load_path_and_require([])
|
12
10
|
@world = RSpec.world
|
13
11
|
@before_suite_run = false
|
14
12
|
end
|
@@ -39,7 +37,7 @@ module RRRSpec
|
|
39
37
|
@configuration.load_spec_files
|
40
38
|
@world.announce_filters
|
41
39
|
unless @before_suite_run
|
42
|
-
|
40
|
+
run_before_suite_hooks
|
43
41
|
@before_suite_run = true
|
44
42
|
end
|
45
43
|
status = true
|
@@ -59,21 +57,11 @@ module RRRSpec
|
|
59
57
|
@configuration.output_stream = $stdout
|
60
58
|
@configuration.error_stream = $stderr
|
61
59
|
@configuration.add_formatter(RSpec::Core::Formatters::BaseTextFormatter)
|
62
|
-
|
63
|
-
|
64
|
-
formatters.each do |formatter|
|
65
|
-
@configuration.formatter_loader.formatters << formatter
|
66
|
-
end
|
67
|
-
else
|
68
|
-
formatters.each do |formatter|
|
69
|
-
@configuration.formatters << formatter
|
70
|
-
end
|
60
|
+
formatters.each do |formatter|
|
61
|
+
@configuration.add_formatter(formatter)
|
71
62
|
end
|
72
|
-
@configuration.reporter.report(
|
73
|
-
@world.
|
74
|
-
@configuration.randomize? ? @configuration.seed : nil
|
75
|
-
) do |reporter|
|
76
|
-
@world.example_groups.ordered.each do |example_group|
|
63
|
+
@configuration.reporter.report(@world.example_count) do |reporter|
|
64
|
+
@world.ordered_example_groups.each do |example_group|
|
77
65
|
example_group.run(reporter)
|
78
66
|
end
|
79
67
|
end
|
@@ -87,6 +75,16 @@ module RRRSpec
|
|
87
75
|
@world.example_groups.clear
|
88
76
|
@configuration.reset
|
89
77
|
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def run_before_suite_hooks
|
82
|
+
hooks = @configuration.instance_variable_get(:@before_suite_hooks)
|
83
|
+
hook_context = RSpec::Core::SuiteHookContext.new
|
84
|
+
hooks.each do |h|
|
85
|
+
h.run(hook_context)
|
86
|
+
end
|
87
|
+
end
|
90
88
|
end
|
91
89
|
end
|
92
90
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'set'
|
2
2
|
require 'extreme_timeout'
|
3
3
|
require 'timeout'
|
4
|
+
require 'rspec/core/formatters'
|
4
5
|
|
5
6
|
module RRRSpec
|
6
7
|
module Client
|
@@ -66,7 +67,7 @@ module RRRSpec
|
|
66
67
|
|
67
68
|
soft_timeout_sec, hard_timeout_sec = spec_timeout_sec(task)
|
68
69
|
|
69
|
-
formatter = RedisReportingFormatter
|
70
|
+
formatter = RedisReportingFormatter
|
70
71
|
trial.start
|
71
72
|
status, outbuf, errbuf = ExtremeTimeout::timeout(
|
72
73
|
hard_timeout_sec, TIMEOUT_EXITCODE
|
@@ -87,41 +88,62 @@ module RRRSpec
|
|
87
88
|
end
|
88
89
|
|
89
90
|
class RedisReportingFormatter
|
90
|
-
|
91
|
+
RSpec::Core::Formatters.register(self, :example_passed, :example_pending, :example_failed)
|
91
92
|
|
92
|
-
def initialize
|
93
|
-
|
94
|
-
@pending = 0
|
95
|
-
@failed = 0
|
96
|
-
@timeout = false
|
93
|
+
def initialize(_output)
|
94
|
+
self.class.reset
|
97
95
|
end
|
98
96
|
|
99
|
-
def example_passed(
|
100
|
-
|
97
|
+
def example_passed(_notification)
|
98
|
+
self.class.example_passed
|
101
99
|
end
|
102
100
|
|
103
|
-
def example_pending(
|
104
|
-
|
101
|
+
def example_pending(_notification)
|
102
|
+
self.class.example_pending
|
105
103
|
end
|
106
104
|
|
107
|
-
def example_failed(
|
108
|
-
|
109
|
-
if example.exception.is_a?(SoftTimeoutException)
|
110
|
-
@timeout = true
|
111
|
-
end
|
105
|
+
def example_failed(notification)
|
106
|
+
self.class.example_failed(notification)
|
112
107
|
end
|
113
108
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
109
|
+
module ClassMethods
|
110
|
+
attr_reader :passed, :pending, :failed
|
111
|
+
|
112
|
+
def reset
|
113
|
+
@passed = 0
|
114
|
+
@pending = 0
|
115
|
+
@failed = 0
|
116
|
+
@timeout = false
|
117
|
+
end
|
118
|
+
|
119
|
+
def example_passed
|
120
|
+
@passed += 1
|
121
|
+
end
|
122
|
+
|
123
|
+
def example_pending
|
124
|
+
@pending += 1
|
125
|
+
end
|
126
|
+
|
127
|
+
def example_failed(notification)
|
128
|
+
@failed += 1
|
129
|
+
if notification.exception.is_a?(SoftTimeoutException)
|
130
|
+
@timeout = true
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def status
|
135
|
+
if @timeout
|
136
|
+
'timeout'
|
137
|
+
elsif @failed != 0
|
138
|
+
'failed'
|
139
|
+
elsif @pending != 0
|
140
|
+
'pending'
|
141
|
+
else
|
142
|
+
'passed'
|
143
|
+
end
|
123
144
|
end
|
124
145
|
end
|
146
|
+
extend ClassMethods
|
125
147
|
end
|
126
148
|
end
|
127
149
|
end
|
data/rrrspec-client.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_dependency "extreme_timeout"
|
30
30
|
spec.add_dependency "launchy"
|
31
31
|
spec.add_dependency "redis"
|
32
|
-
spec.add_dependency "rspec", ">=
|
32
|
+
spec.add_dependency "rspec", ">= 3.0"
|
33
33
|
spec.add_dependency "thor"
|
34
34
|
spec.add_dependency "uuidtools"
|
35
35
|
spec.add_dependency "tzinfo"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rrrspec-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaya Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,20 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
104
|
-
- - "<"
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: '3'
|
103
|
+
version: '3.0'
|
107
104
|
type: :runtime
|
108
105
|
prerelease: false
|
109
106
|
version_requirements: !ruby/object:Gem::Requirement
|
110
107
|
requirements:
|
111
108
|
- - ">="
|
112
109
|
- !ruby/object:Gem::Version
|
113
|
-
version:
|
114
|
-
- - "<"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '3'
|
110
|
+
version: '3.0'
|
117
111
|
- !ruby/object:Gem::Dependency
|
118
112
|
name: thor
|
119
113
|
requirement: !ruby/object:Gem::Requirement
|