forking_test_runner 1.12.0 → 1.13.0

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: be87df3e12024204491610717130bc0b71a3b7fc02d6a60c82da34ebedbf74c6
4
- data.tar.gz: 4e6fb9c449dc7e00c46e39fdbc7686bcfe0bf1df439c800e78767950a517f6c4
3
+ metadata.gz: 6d802108391cd0edbb4c9a9628ca56d447dbc07992f07cf8c1ffc1e61d770d5a
4
+ data.tar.gz: cabbf4e263465b03e1bc47435b15ce5186c3478f409095f57d2197e49ca5e0e5
5
5
  SHA512:
6
- metadata.gz: 323f765b32f2ed37f62a82dfff10b6bdc7c0c8670a441f340f2a910d8dfb17a9660726698b8c34dfb89522246003e8c7fde4a205d17b8511c3ec432027604a65
7
- data.tar.gz: ad243eb959c09b3bac8d58da961adec4c34b92844b239da2e541d599e2f1b78d738bdc3cc5db7b44c4817e18aa99be86d5adb74bac2e5614c01b57c027a0b562
6
+ metadata.gz: 921396a5eec38e183f71ab4ba42340dad7c34f81d622af12ad9df156c639ce0c41d53ba0bcaff9c3e5efa6e52d5416a1676a018f6cacb1e4aa01fb820d338781
7
+ data.tar.gz: c79fcf65d60af55227c194baf05c86275a1d6d2b1132fa14bd311480d982b490b40d991c02f8a14ad9a95f7578fbd92ee1b6f7a7e32108dc9a853c4d92594f90
@@ -1,3 +1,3 @@
1
1
  module ForkingTestRunner
2
- VERSION = "1.12.0"
2
+ VERSION = "1.13.0"
3
3
  end
@@ -11,6 +11,9 @@ module ForkingTestRunner
11
11
  CONVERAGE_REPORT_PREFIX = "coverage/fork-"
12
12
 
13
13
  class << self
14
+
15
+ attr_accessor :before_fork_callbacks, :after_fork_callbacks
16
+
14
17
  def cli(argv)
15
18
  @options, tests = CLI.parse_options(argv)
16
19
 
@@ -34,6 +37,9 @@ module ForkingTestRunner
34
37
  puts "Running tests #{all_tests.map(&:first).join(" ")}"
35
38
  end
36
39
 
40
+ @before_fork_callbacks = []
41
+ @after_fork_callbacks = []
42
+
37
43
  # run all the tests
38
44
  results = with_lock do |lock|
39
45
  Parallel.map_with_index(test_groups, in_processes: parallel || 0) do |tests, env_index|
@@ -195,6 +201,7 @@ module ForkingTestRunner
195
201
  preload_fixtures
196
202
  ActiveRecord::Base.connection.disconnect!
197
203
  end
204
+ @before_fork_callbacks.each(&:call)
198
205
 
199
206
  CoverageCapture.capture! if @options.fetch(:merge_coverage)
200
207
  end
@@ -289,6 +296,9 @@ module ForkingTestRunner
289
296
  if partial_reports_for_single_cov?
290
297
  SingleCov.coverage_report = "#{CONVERAGE_REPORT_PREFIX}#{Process.pid}.json"
291
298
  end
299
+
300
+ @after_fork_callbacks.each(&:call)
301
+
292
302
  if active_record?
293
303
  key = (ActiveRecord::VERSION::STRING >= "4.1.0" ? :test : "test")
294
304
  ActiveRecord::Base.establish_connection key
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forking_test_runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-19 00:00:00.000000000 Z
11
+ date: 2021-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel_tests