selective-ruby-rspec 0.1.6 → 0.1.8
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b90214dbde7f85237970ade3e522dfee6cc44b367edc021fdba95820686d2d9
|
4
|
+
data.tar.gz: 9719db25e251200e491d45f9094461680e0d2953eb66834f81d0748fa572282d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f7690d0daabbc30d2ec52a7b82dd061bc0586a1226d30ac2989327c6bd73dcb8632c0c939e8a6b76b6e2654b9b1c2cfe21ba576a7c575eb015ebedd1b68aa0b
|
7
|
+
data.tar.gz: 6f25414691962aa6f07d40f97495469137c719796c999be8c785890d072a33959bed73f8e9c9577b1ff7c2ded44141afc1d609b475df40681ad1758d3d5fd0c1
|
@@ -19,6 +19,7 @@ module Selective
|
|
19
19
|
self.class.runner_wrapper.report_example(notification.example)
|
20
20
|
rescue Selective::Ruby::Core::ConnectionLostError
|
21
21
|
::RSpec.world.wants_to_quit = true
|
22
|
+
self.class.runner_wrapper.connection_lost = true
|
22
23
|
self.class.runner_wrapper.remove_test_case_result(notification.example.id)
|
23
24
|
end
|
24
25
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'benchmark'
|
2
|
+
|
1
3
|
module Selective
|
2
4
|
module Ruby
|
3
5
|
module RSpec
|
@@ -154,8 +156,20 @@ module Selective
|
|
154
156
|
module Hooks
|
155
157
|
HOOKS.each do |hook|
|
156
158
|
define_method(hook) do |*args, &block|
|
157
|
-
|
158
|
-
|
159
|
+
if args.any? { |a| a == :all}
|
160
|
+
args = args.map { |a| a == :all ? :each : a }
|
161
|
+
super(*args, &->(example) {
|
162
|
+
Benchmark.measure { example.instance_exec(example, &block) }.tap do |time|
|
163
|
+
Selective::Ruby::Core::Controller.report_at_finish.tap do |report_at_finish|
|
164
|
+
key = :"seconds_in_#{hook}_all_hooks"
|
165
|
+
report_at_finish[key] ||= 0
|
166
|
+
report_at_finish[key] += time.real
|
167
|
+
end
|
168
|
+
end
|
169
|
+
})
|
170
|
+
else
|
171
|
+
super(*args, &block)
|
172
|
+
end
|
159
173
|
end
|
160
174
|
end
|
161
175
|
end
|
@@ -8,6 +8,7 @@ module Selective
|
|
8
8
|
class TestManifestError < StandardError; end
|
9
9
|
|
10
10
|
attr_reader :rspec_runner, :config, :example_callback
|
11
|
+
attr_accessor :connection_lost
|
11
12
|
|
12
13
|
FRAMEWORK = "rspec"
|
13
14
|
DEFAULT_SPEC_PATH = "./spec"
|
@@ -49,6 +50,10 @@ module Selective
|
|
49
50
|
ensure_test_phase
|
50
51
|
configure(test_case_ids)
|
51
52
|
rspec_runner.run_specs(optimize_test_filtering(test_case_ids).to_a)
|
53
|
+
if connection_lost
|
54
|
+
self.connection_lost = false
|
55
|
+
raise Selective::Ruby::Core::ConnectionLostError
|
56
|
+
end
|
52
57
|
end
|
53
58
|
|
54
59
|
def exec
|
@@ -70,7 +75,13 @@ module Selective
|
|
70
75
|
end
|
71
76
|
|
72
77
|
def exit_status
|
73
|
-
::RSpec.
|
78
|
+
if Gem::Version.new(::RSpec::Core::Version::STRING) >= Gem::Version.new("3.10")
|
79
|
+
rspec_runner.exit_code(::RSpec.world.reporter.failed_examples.none?)
|
80
|
+
else
|
81
|
+
return ::RSpec.world.reporter.exit_early(rspec_runner.configuration.failure_exit_code) if ::RSpec.world.wants_to_quit
|
82
|
+
|
83
|
+
::RSpec.world.reporter.failed_examples.any? ? 1 : 0
|
84
|
+
end
|
74
85
|
end
|
75
86
|
|
76
87
|
def finish
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selective-ruby-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Wood
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: zeitwerk
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
83
|
+
rubygems_version: 3.5.3
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Selective Ruby RSpec Client
|