flatware-rspec 2.2.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6dc82410c01271fc060c886e06a08424f936cd7e5dc0cf94bedb51573170fec
4
- data.tar.gz: '07549006135ea25829b0d517e219c54d7604a65f3a0799f7ed97efdf69be33c6'
3
+ metadata.gz: ed684fc96c679f2fa616a18eb64183066f1f686e86fcefbb7cbc7d1ed633f2fa
4
+ data.tar.gz: ce541ce14cd85b542b1794f60f46494b1a157292a146121c6dbfe3bfb5342960
5
5
  SHA512:
6
- metadata.gz: b3417253006d6512d94195030c7562399c3a3c70e64b132931ae72f20e85f406ba40c5bd8f49a05788a37c568a2a20e7b13718d03e0b3aa7cae237707cee75ba
7
- data.tar.gz: a27dc33a38a65d5301cc476ed1646c753cb66e7741a76511a73737c3a7c6114db83c9f39feaa1d251badb355a71361eb1f82358b4a539cfc10cbf89d6bbd2579
6
+ metadata.gz: 59eebe27638af1a6c0bfd3c6fcd73a202c5c37060b51944d4074fc09fb8046835a6112ac4966565b3066df38338ca468827d9d42fd5930d37f0c7b38a9d172cb
7
+ data.tar.gz: 6bf0e48850665d8342885fd43fab1e76eb2195a83b221eccadb422c6285c622622bc4b5a1205dc372bab33cc0aee68c8b14ac7701a6d23e367364a85bf2507d6
data/README.md CHANGED
@@ -106,6 +106,11 @@ Flatware has a couple lifecycle callbacks that you can use to avoid booting your
106
106
  over again on every core. One way to take advantage of this via a `spec/flatware_helper.rb` file like so:
107
107
 
108
108
  ```ruby
109
+ ##
110
+ # uncomment if you get a segmentation fault from the "pg" gem
111
+ # @see https://github.com/ged/ruby-pg/issues/311#issuecomment-1609970533
112
+ # ENV["PGGSSENCMODE"] = "disable"
113
+
109
114
  Flatware.configure do |conf|
110
115
  conf.before_fork do
111
116
  require 'rails_helper'
@@ -114,6 +119,11 @@ Flatware.configure do |conf|
114
119
  end
115
120
 
116
121
  conf.after_fork do |test_env_number|
122
+ ##
123
+ # uncomment if you're using SimpleCov and have started it in `rails_helper` as suggested here:
124
+ # @see https://github.com/simplecov-ruby/simplecov/tree/main?tab=readme-ov-file#use-it-with-any-framework
125
+ # SimpleCov.at_fork.call(test_env_number)
126
+
117
127
  config = ActiveRecord::Base.connection_db_config.configuration_hash
118
128
 
119
129
  ActiveRecord::Base.establish_connection(
@@ -126,6 +136,15 @@ end
126
136
  ```
127
137
  Now when I run `bundle exec flatware rspec -r ./spec/flatware_helper` My app only boots once, rather than once per core.
128
138
 
139
+ ## SimpleCov
140
+
141
+ If you're using SimpleCov, follow [their directions](https://github.com/simplecov-ruby/simplecov/tree/main?tab=readme-ov-file#use-it-with-any-framework) to install. When you have it working as desired for serial runs, add
142
+ `SimpleCov.at_fork.call(test_env_number)` to flatware's `after_fork` hook. You should now get the same coverage stats from parallel and serial runs.
143
+
144
+ ## Segmentation faults in the PG gem
145
+
146
+ If you get a segmentation fault on start you may need to add `ENV["PGGSSENCMODE"] = "disable"` to the top of your flatware helper.
147
+
129
148
  ## Design Goals
130
149
 
131
150
  ### Maintainable
@@ -170,3 +189,10 @@ Do whatever you want. I'd love to help make sure Flatware meets your needs.
170
189
  [![Hashrocket logo](https://hashrocket.com/hashrocket_logo.svg)](https://hashrocket.com)
171
190
 
172
191
  Flatware is supported by the team at [Hashrocket](https://hashrocket.com), a multidisciplinary design & development consultancy. If you'd like to [work with us](https://hashrocket.com/contact-us/hire-us) or [join our team](https://hashrocket.com/contact-us/jobs), don't hesitate to get in touch.
192
+
193
+
194
+ # TODO:
195
+
196
+ possible simplecov fixes
197
+
198
+ 1. seems like we won't get the same results as serial rspec runs unless we start simplecov after fork. And if we do that, I think a process needs to claim to be the last one for simplecov to run the merge.
@@ -6,7 +6,15 @@ module Flatware
6
6
  module Marshalable
7
7
  class SummaryNotification < ::RSpec::Core::Notifications::SummaryNotification
8
8
  def +(other)
9
- self.class.new(*zip(other).map { |a, b| a + b })
9
+ values = to_h.map do |key, value|
10
+ if %i[duration load_time].include?(key)
11
+ [value, other.public_send(key)].max
12
+ else
13
+ value + other.public_send(key)
14
+ end
15
+ end
16
+
17
+ self.class.new(*values)
10
18
  end
11
19
 
12
20
  def failures?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flatware-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2024-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flatware
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.2.0
19
+ version: 2.3.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.2.0
26
+ version: 2.3.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement