rspec-conductor 1.0.11 → 1.0.12

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: 4a4f284fb6887972bbd325f6a5d6ce77b3c384d3cc7b8933c19bd04af2aa3ada
4
- data.tar.gz: 733f1d8de0935949b77aa54374f37f97976a007c7dc53381b1dc8d8bb3e6922d
3
+ metadata.gz: 2adf2982f4c0054337c9cc8b405231af7584e34d424286dea68099592a467618
4
+ data.tar.gz: e583031bf5ce03f04e462f1b74037cdf6ea7b495c3c0cbe15a0eb1cec4d0e699
5
5
  SHA512:
6
- metadata.gz: e23c66e05afe4064b4a6062d6f7880429e641c5e2a3eac73f60a50ba5bd4c75ecb2b36a8484405200e9e8102f0cfd24b20fb99a0fbdf959be376e0087cf4006d
7
- data.tar.gz: ebc3ad89f178da346ce4a5aee153e280b8b10b98f2c1d4e55894035237ee9f990e34206f272f35128d0e94da7c01847acd15225ab7a8db0516ceb674618f1887
6
+ metadata.gz: 4308277ebb07fb4aa16a67a833d518c7f2d8a0479aa3a13050fcb067f91222def4a206ba7b23a147a2f17f7c76df7ca42d7b04b0a19193f5bc875f1196a44d95
7
+ data.tar.gz: bb41bf5812b8d7b5dcf7691de809035e3ce444854b7d6290f4e7bae705887d99d3cbd982c7bc82b6f4b6b2e66ebd7de7840859c0c2d62737bd4e520b1a249f30
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.12] - 2026-09-12
2
+
3
+ - Add --example-status-persistence option to mimic rspec example status persistence runner config and to support --only-failures on repeat runs
4
+
1
5
  ## [1.0.11] - 2026-08-03
2
6
 
3
7
  - Fix a bug in 2.x that would cause an exception because of the 3.x syntax usage (`_1`) in the formatter base
@@ -16,6 +16,7 @@ module RSpec
16
16
  prefork_require: 'config/application.rb',
17
17
  postfork_require: :spec_helper,
18
18
  print_slowest_count: nil,
19
+ example_status_persistence_path: Conductor.default_example_status_persistence_path,
19
20
  }.freeze
20
21
 
21
22
  def self.run(argv)
@@ -102,6 +103,10 @@ module RSpec
102
103
  @conductor_options[:print_slowest_count] = n
103
104
  end
104
105
 
106
+ opts.on("--example-status-persistence-path FILENAME", String, "Persist example statuses to a given file (same as rspec config.example_status_persistence_file_path)") do |filename|
107
+ @conductor_options[:example_status_persistence_path] = filename
108
+ end
109
+
105
110
  opts.on("--verbose", "Enable debug output") do
106
111
  @conductor_options[:verbose] = true
107
112
  end
@@ -126,6 +131,7 @@ module RSpec
126
131
  formatter: @conductor_options[:formatter],
127
132
  display_retry_backtraces: @conductor_options[:display_retry_backtraces],
128
133
  print_slowest_count: @conductor_options[:print_slowest_count],
134
+ example_status_persistence_path: @conductor_options[:example_status_persistence_path],
129
135
  verbose: @conductor_options[:verbose],
130
136
  ).run
131
137
  end
@@ -0,0 +1,20 @@
1
+ module RSpec
2
+ module Conductor
3
+ module ExampleStatusPersister
4
+ # RSpec::Core::ExampleStatusPersister is a private api, but it's been fairly stable over the versions
5
+ # we want to support, so I don't expect issues using these stubs.
6
+ ExampleStub = Struct.new(:id, :execution_result)
7
+ ExampleExecutionResultStub = Struct.new(:status, :run_time)
8
+
9
+ def self.persist(example_stats, filename)
10
+ examples = example_stats.map do |stat|
11
+ ExampleStub.new(
12
+ stat[:id],
13
+ ExampleExecutionResultStub.new(stat[:status], stat[:run_time])
14
+ )
15
+ end
16
+ RSpec::Core::ExampleStatusPersister.persist(examples, filename)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -17,12 +17,14 @@ module RSpec
17
17
  end
18
18
 
19
19
  def example_passed(notification)
20
+ ex = notification.example
20
21
  @socket.send_message(
21
22
  type: :example_passed,
23
+ id: ex.id,
22
24
  file: @file,
23
- description: notification.example.full_description,
24
- location: notification.example.location,
25
- run_time: notification.example.execution_result.run_time
25
+ description: ex.full_description,
26
+ location: ex.location,
27
+ run_time: ex.execution_result.run_time
26
28
  )
27
29
  @shutdown_check.call
28
30
  end
@@ -31,6 +33,7 @@ module RSpec
31
33
  ex = notification.example
32
34
  @socket.send_message(
33
35
  type: :example_failed,
36
+ id: ex.id,
34
37
  file: @file,
35
38
  description: ex.full_description,
36
39
  location: ex.location,
@@ -46,6 +49,7 @@ module RSpec
46
49
  ex = notification.example
47
50
  @socket.send_message(
48
51
  type: :example_pending,
52
+ id: ex.id,
49
53
  file: @file,
50
54
  description: ex.full_description,
51
55
  location: ex.location,
@@ -24,9 +24,10 @@ module RSpec
24
24
  @postfork_require = opts.fetch(:postfork_require, nil)
25
25
  @first_is_1 = opts.fetch(:first_is_1, Conductor.default_first_is_1?)
26
26
  @seed = opts[:seed] || (Random.new_seed % MAX_SEED)
27
- @fail_fast_after = opts[:fail_fast_after]
27
+ @fail_fast_after = opts.fetch(:fail_fast_after, nil)
28
28
  @display_retry_backtraces = opts.fetch(:display_retry_backtraces, false)
29
29
  @print_slowest_count = opts.fetch(:print_slowest_count, nil)
30
+ @example_status_persistence_path = opts.fetch(:example_status_persistence_path, nil)
30
31
  @verbose = opts.fetch(:verbose, false)
31
32
 
32
33
  @rspec_args = rspec_args
@@ -65,6 +66,7 @@ module RSpec
65
66
 
66
67
  @formatter.print_summary(@suite_run, seed: @seed, success: success?)
67
68
  @formatter.print_slowest(@suite_run, @print_slowest_count) if @print_slowest_count
69
+ Conductor::ExampleStatusPersister.persist(@suite_run.example_stats, @example_status_persistence_path) if @example_status_persistence_path
68
70
  exit_with_status
69
71
  end
70
72
 
@@ -169,7 +171,9 @@ module RSpec
169
171
  initiate_shutdown
170
172
  end
171
173
  when :example_pending
172
- @suite_run.example_pending
174
+ @suite_run.example_pending(message)
175
+ when :example_filtered
176
+ @suite_run.example_filtered(message)
173
177
  when :example_retried
174
178
  @formatter.print_retry_message(message) if @display_retry_backtraces
175
179
  when :spec_complete
@@ -24,20 +24,25 @@ module RSpec
24
24
  end
25
25
 
26
26
  def example_passed(message)
27
- @example_stats << message.slice(:location, :run_time, :description)
27
+ @example_stats << message.slice(:id, :location, :run_time, :description).merge(status: "passed")
28
28
  @examples_passed += 1
29
29
  end
30
30
 
31
31
  def example_failed(message)
32
- @example_stats << message.slice(:location, :run_time, :description)
32
+ @example_stats << message.slice(:id, :location, :run_time, :description).merge(status: "failed")
33
33
  @examples_failed += 1
34
34
  @errors << message
35
35
  end
36
36
 
37
- def example_pending
37
+ def example_pending(message)
38
+ @example_stats << message.slice(:id, :location).merge(status: "pending")
38
39
  @examples_pending += 1
39
40
  end
40
41
 
42
+ def example_filtered(message)
43
+ @example_stats << message.slice(:id, :location).merge(status: nil)
44
+ end
45
+
41
46
  def spec_file_assigned
42
47
  @specs_started_at ||= Time.now
43
48
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module Conductor
5
- VERSION = "1.0.11"
5
+ VERSION = "1.0.12"
6
6
  end
7
7
  end
@@ -129,6 +129,16 @@ module RSpec
129
129
  example_groups.each { |g| g.run(reporter) }
130
130
  end
131
131
 
132
+ RSpec.world.all_examples.reject { |e| e.execution_result.status }.each do |e|
133
+ @socket.send_message(
134
+ type: :example_filtered,
135
+ id: e.id,
136
+ file: file,
137
+ description: e.full_description,
138
+ location: e.location
139
+ )
140
+ end
141
+
132
142
  @socket.send_message(
133
143
  type: :spec_complete,
134
144
  file: file,
@@ -24,6 +24,10 @@ module RSpec
24
24
  def self.default_first_is_1?
25
25
  ENV["RSPEC_CONDUCTOR_FIRST_IS_1"] == "1"
26
26
  end
27
+
28
+ def self.default_example_status_persistence_path
29
+ ENV["RSPEC_CONDUCTOR_EXAMPLE_STATUS_PERSISTENCE_PATH"]
30
+ end
27
31
  end
28
32
  end
29
33
 
@@ -43,6 +47,7 @@ require_relative "conductor/formatters/base"
43
47
  require_relative "conductor/formatters/plain"
44
48
  require_relative "conductor/formatters/ci"
45
49
  require_relative "conductor/formatters/fancy"
50
+ require_relative "conductor/example_status_persister"
46
51
 
47
52
  require_relative "conductor/ext/rspec"
48
53
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-conductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Abramov
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-08-02 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rspec-core
@@ -42,6 +41,7 @@ files:
42
41
  - exe/rspec-conductor
43
42
  - lib/rspec/conductor.rb
44
43
  - lib/rspec/conductor/cli.rb
44
+ - lib/rspec/conductor/example_status_persister.rb
45
45
  - lib/rspec/conductor/ext/rspec.rb
46
46
  - lib/rspec/conductor/formatters/base.rb
47
47
  - lib/rspec/conductor/formatters/ci.rb
@@ -69,7 +69,6 @@ metadata:
69
69
  homepage_uri: https://github.com/markiz/rspec-conductor
70
70
  source_code_uri: https://github.com/markiz/rspec-conductor
71
71
  changelog_uri: https://github.com/markiz/rspec-conductor/blob/master/CHANGELOG.md
72
- post_install_message:
73
72
  rdoc_options: []
74
73
  require_paths:
75
74
  - lib
@@ -84,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
83
  - !ruby/object:Gem::Version
85
84
  version: '0'
86
85
  requirements: []
87
- rubygems_version: 3.3.26
88
- signing_key:
86
+ rubygems_version: 4.0.6
89
87
  specification_version: 4
90
88
  summary: Queue-based parallel test runner for rspec
91
89
  test_files: []