parallel_rspec 2.6.0 → 3.0.1

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: 2a9882673bf7a63db2cf0e99d04ddf76baf37a1423ffed5e5b7cd7a9a40bbbb3
4
- data.tar.gz: cef36e60b39e5500249b3c1c12cfd9f0bb985c39a5e80207b028428da81aeb08
3
+ metadata.gz: cdfedb35d24a596db8d4e573cad271b526af96bd2035ba33701d628f477f39a0
4
+ data.tar.gz: 55c81e97220b325cdaccc73910401829f8d6ec5171f8caebb312a0ad171dbfb7
5
5
  SHA512:
6
- metadata.gz: 0cac3c2057c28687d434ad6ed21aa378089f6132e4948c154b998a4ba0e735d2d5a69d3983231abc2b76841dc004474cf97f60afe13d18e3a8dbec747744f14b
7
- data.tar.gz: 605f72e97c9ca1ae86bc20511c2735de32e59dafef6fa17566d7b3eaa29bc3610f669e98185424f70f86c57e210e0591e7deef8b7441e4e4294390ee34d60ce7
6
+ metadata.gz: 1fa63512acf7d08f00c8cbdae971a12558214a8ab3fd85a5698fbc81c900d6bf9e7b314227dea2bd76daf055398b8a13cebe49b8b26c3768c29d967eac7df501
7
+ data.tar.gz: a03409838a0a7fcb24b9b999187c48a7e1bd4215b0f08e113a162d49dd0a76de1d1381caa13b71287b3b234eaf36404ecc1d8a44f112dc15edbb16eff0df18ac
data/CHANGES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0
4
+
5
+ * Fix reporting of `aggregate_failures` errors.
6
+ * Add this gem's files to the backtrace filter RSpec uses to exclude its own files from failure messages.
7
+ * Implement `--fail-fast` support.
8
+
3
9
  ## 2.6.0
4
10
 
5
11
  * Fix `--profile` support. Thanks @peret.
@@ -18,12 +24,12 @@
18
24
 
19
25
  ## 2.4.0
20
26
 
21
- * Wrap Exception objects so they can always be dumped and loaded, even if they contain non-marshallable objects such as Procs or anonymous classes.
27
+ * Wrap `Exception` objects so they can always be dumped and loaded, even if they contain non-marshallable objects such as `Proc`s or anonymous classes.
22
28
 
23
29
  ## 2.3.0
24
30
 
25
31
  * Increase default workers from 2 to 4.
26
- * Fix behavioral inconsistency with rspec-core in nested describe blocks on helper methods with clashing let methods.
32
+ * Fix behavioral inconsistency with rspec-core in nested describe blocks on helper methods with clashing `let` methods.
27
33
 
28
34
  ## 2.2.0
29
35
 
@@ -39,13 +45,13 @@
39
45
 
40
46
  ## 2.1.0
41
47
 
42
- * Add a default parallel_rspec rake task.
43
- * Add task descriptions for rake --tasks.
48
+ * Add a default `parallel_rspec` rake task.
49
+ * Add task descriptions for `rake --tasks`.
44
50
 
45
51
  ## 2.0.0
46
52
 
47
53
  * Remove an unnecessary dev dependency to pacify dependabot.
48
- * Add after_fork hook and running? method. Thanks @mogest.
54
+ * Add `after_fork` hook and `running?` method. Thanks @mogest.
49
55
  * Upgrade for compatibility with Rails 6.1 and RSpec 3.10. Thanks @mogest.
50
56
 
51
57
  ## 1.2.0
@@ -0,0 +1,11 @@
1
+ require "rspec/support/caller_filter"
2
+
3
+ if RSpec.const_defined?(:CallerFilter) && RSpec::CallerFilter.const_defined?(:IGNORE_REGEX)
4
+ module RSpec
5
+ class CallerFilter
6
+ _ignore_regex = Regexp.union(IGNORE_REGEX, "/lib/parallel_rspec", "parallel_rspec/exe/prspec")
7
+ remove_const :IGNORE_REGEX
8
+ IGNORE_REGEX = _ignore_regex
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,5 @@
1
+ require "rspec/core"
2
+
1
3
  module ParallelRSpec
2
4
  # Some Exception objects contain non-marshallable ivars such as Proc objects. This wrapper
3
5
  # represents the bits needed by RSpec's ExceptionPresenter, and can be dumped and loaded.
@@ -28,6 +30,21 @@ module ParallelRSpec
28
30
  end
29
31
  end
30
32
 
33
+ class MultipleExceptionMarshallingWrapper < ExceptionMarshallingWrapper
34
+ include ::RSpec::Core::MultipleExceptionError::InterfaceTag
35
+
36
+ attr_reader :all_exceptions, :aggregation_block_label, :aggregation_metadata, :exception_count_description, :summary
37
+
38
+ def initialize(class_name, message, backtrace, cause, all_exceptions, aggregation_block_label, aggregation_metadata, exception_count_description, summary)
39
+ super(class_name, message, backtrace, cause)
40
+ @all_exceptions = all_exceptions
41
+ @aggregation_block_label = aggregation_block_label
42
+ @aggregation_metadata = aggregation_metadata
43
+ @exception_count_description = exception_count_description
44
+ @summary = summary
45
+ end
46
+ end
47
+
31
48
  class Client
32
49
  attr_reader :channel_to_server
33
50
 
@@ -72,8 +89,31 @@ module ParallelRSpec
72
89
  end
73
90
 
74
91
  def dumpable_exception(exception)
75
- return exception if exception.nil? || exception.is_a?(ExceptionMarshallingWrapper)
76
- ExceptionMarshallingWrapper.new(exception.class.name, exception.to_s, exception.backtrace, dumpable_exception(exception.cause))
92
+ case exception
93
+ when nil
94
+ nil
95
+ when ExceptionMarshallingWrapper
96
+ exception
97
+ when ::RSpec::Core::MultipleExceptionError::InterfaceTag
98
+ MultipleExceptionMarshallingWrapper.new(
99
+ exception.class.name,
100
+ exception.message,
101
+ exception.backtrace,
102
+ dumpable_exception(exception.cause),
103
+ exception.all_exceptions.map { |exception| dumpable_exception(exception) },
104
+ exception.aggregation_block_label,
105
+ exception.aggregation_metadata,
106
+ exception.exception_count_description,
107
+ exception.summary,
108
+ )
109
+ else
110
+ ExceptionMarshallingWrapper.new(
111
+ exception.class.name,
112
+ exception.message,
113
+ exception.backtrace,
114
+ dumpable_exception(exception.cause),
115
+ )
116
+ end
77
117
  end
78
118
 
79
119
  def next_example_to_run
@@ -56,7 +56,7 @@ module ParallelRSpec
56
56
  end
57
57
 
58
58
  def next_example_to_run(channel_to_client)
59
- if remaining_examples_by_group.empty?
59
+ if remaining_examples_by_group.empty? || reporter.fail_fast_limit_met?
60
60
  channel_to_client.write(nil)
61
61
  else
62
62
  example_group = remaining_examples_by_group.keys.first
@@ -1,3 +1,3 @@
1
1
  module ParallelRSpec
2
- VERSION = "2.6.0"
2
+ VERSION = "3.0.1"
3
3
  end
@@ -5,6 +5,7 @@ require "parallel_rspec/workers"
5
5
  require "parallel_rspec/example"
6
6
  require "parallel_rspec/server"
7
7
  require "parallel_rspec/client"
8
+ require "parallel_rspec/caller_filter_patch"
8
9
  require "parallel_rspec/rake_task"
9
10
  require "parallel_rspec/runner"
10
11
  require "parallel_rspec/railtie"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Bryant, Powershop New Zealand Ltd
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-11-03 00:00:00.000000000 Z
11
+ date: 2026-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -57,6 +57,7 @@ files:
57
57
  - Rakefile
58
58
  - exe/prspec
59
59
  - lib/parallel_rspec.rb
60
+ - lib/parallel_rspec/caller_filter_patch.rb
60
61
  - lib/parallel_rspec/channel.rb
61
62
  - lib/parallel_rspec/client.rb
62
63
  - lib/parallel_rspec/config.rb