forking_test_runner 1.14.0 → 1.15.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: e38d2bbf3dd185f3f8c912537be54a0068c98db3c45b17edda9a53a01ccd63d8
4
- data.tar.gz: 63393812f02d8841d6ee56c000d9400e0062f405d7eb95eccbd766a93877e7d8
3
+ metadata.gz: 0a7ebca8b454c091bb661a22944f47dfe076bca28881204c35d5c5406e2edf99
4
+ data.tar.gz: 2fdc6f9e18ae663f4c6ebca965e494af978e99ed6bd38fa91527e530844a9f2b
5
5
  SHA512:
6
- metadata.gz: 1cf9450f7cf1fc7259bf5ec9a51f88141ce7e937aca94152577919117ff1fbec3311591f045b01864cd644b6ada45e71265656c91c067242da7c4195e987df27
7
- data.tar.gz: ac79e34dab39a08445773c394b1912f7119605187cf2a09af670e94f54b2c2d786dc43a09968e50443881220d7d62f7bfcebf167521569b497d96603714962d5
6
+ metadata.gz: 53998b0c82cea8ab99a6605f2a834b251d62f24c174b8dc482f917bdcc249c691a6602508e1d23b728a67a04cdd3c6c82b104fe4586dcce243f4845f9789c692
7
+ data.tar.gz: 6e507d5539e50ddf61efcc23c879270a74e7a81f28f7bf4d278b0bf19183ca2234c23ec776f0cc2ab269640b53f5bb902ac6aae186af5a1f44643bcc67f48a8d
@@ -28,7 +28,7 @@ module ForkingTestRunner
28
28
  class << self
29
29
  def parse_options(argv)
30
30
  options = OPTIONS.each_with_object({}) do |(setting, flag, _, type), all|
31
- all[setting] = delete_argv(flag.split('=', 2)[0], argv, type: type)
31
+ all[setting] = delete_argv(flag.split('=', 2)[0], argv, type:)
32
32
  end
33
33
 
34
34
  # show version
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ForkingTestRunner
3
- VERSION = "1.14.0"
3
+ VERSION = "1.15.0"
4
4
  end
@@ -9,7 +9,7 @@ require 'tempfile'
9
9
 
10
10
  module ForkingTestRunner
11
11
  CLEAR = "------"
12
- CONVERAGE_REPORT_PREFIX = "coverage/fork-"
12
+ COVERAGE_REPORT_PREFIX = "coverage/fork-"
13
13
 
14
14
  class << self
15
15
  attr_accessor :before_fork_callbacks, :after_fork_callbacks
@@ -96,9 +96,9 @@ module ForkingTestRunner
96
96
 
97
97
  private
98
98
 
99
- def with_lock(&block)
99
+ def with_lock(&)
100
100
  return yield unless @options.fetch(:parallel)
101
- Tempfile.open "forking-test-runner-lock", &block
101
+ Tempfile.open("forking-test-runner-lock", &)
102
102
  end
103
103
 
104
104
  def sync_stdout(lock)
@@ -237,14 +237,21 @@ module ForkingTestRunner
237
237
  # reuse our pre-loaded fixtures even if we have a different connection
238
238
  fixtures = ActiveRecord::FixtureSet
239
239
  fixtures_eigenclass = class << fixtures; self; end
240
- fixtures_eigenclass.send(:define_method, :cache_for_connection) do |_connection|
240
+
241
+ name = (ActiveRecord::VERSION::STRING >= "7.2.0" ? :cache_for_connection_pool : :cache_for_connection)
242
+ fixtures_eigenclass.send(:define_method, name) do |_pool|
241
243
  fixtures.class_variable_get(:@@all_cached_fixtures)[:unique]
242
244
  end
243
245
 
244
246
  ActiveSupport::TestCase.fixtures :all
245
247
 
246
248
  fixtures.create_fixtures(
247
- ActiveSupport::TestCase.fixture_path,
249
+ (if ActiveSupport::TestCase.respond_to?(:fixture_paths)
250
+ ActiveSupport::TestCase.fixture_paths
251
+ else
252
+ ActiveSupport::TestCase.fixture_path
253
+ end
254
+ ), # TODO: remove after dropping rails 7,0 support
248
255
  ActiveSupport::TestCase.fixture_table_names,
249
256
  ActiveSupport::TestCase.fixture_class_names
250
257
  )
@@ -300,14 +307,13 @@ module ForkingTestRunner
300
307
  SimpleCov.command_name file
301
308
  end
302
309
  if partial_reports_for_single_cov?
303
- SingleCov.coverage_report = "#{CONVERAGE_REPORT_PREFIX}#{Process.pid}.json"
310
+ SingleCov.coverage_report = "#{COVERAGE_REPORT_PREFIX}#{Process.pid}.json"
304
311
  end
305
312
 
306
313
  @after_fork_callbacks.each(&:call)
307
314
 
308
315
  if active_record?
309
- key = (ActiveRecord::VERSION::STRING >= "4.1.0" ? :test : "test")
310
- ActiveRecord::Base.establish_connection key
316
+ ActiveRecord::Base.establish_connection :test
311
317
  end
312
318
  enable_test_autorun(file)
313
319
  end
@@ -338,8 +344,8 @@ module ForkingTestRunner
338
344
  tests = ParallelTests::Test::Runner.send(
339
345
  :tests_with_size,
340
346
  tests,
341
- runtime_log: runtime_log,
342
- group_by: group_by
347
+ runtime_log:,
348
+ group_by:
343
349
  )
344
350
  groups = ParallelTests::Grouper.in_even_groups_by_size(tests, group_count, {})
345
351
  group = groups[group - 1] || raise("Group #{group} not found")
@@ -383,7 +389,7 @@ module ForkingTestRunner
383
389
  end
384
390
 
385
391
  def summarize_partial_reports
386
- reports = Dir.glob("#{CONVERAGE_REPORT_PREFIX}*")
392
+ reports = Dir.glob("#{COVERAGE_REPORT_PREFIX}*")
387
393
  return if reports.empty?
388
394
  key = nil
389
395
 
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.14.0
4
+ version: 1.15.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: 2024-08-21 00:00:00.000000000 Z
11
+ date: 2024-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel_tests
@@ -44,20 +44,48 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.3'
47
+ version: '2.4'
48
48
  - - ">="
49
49
  - !ruby/object:Gem::Version
50
- version: 2.3.27
50
+ version: 2.4.22
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: '2.3'
57
+ version: '2.4'
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 2.3.27
60
+ version: 2.4.22
61
+ - !ruby/object:Gem::Dependency
62
+ name: drb
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: logger
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
61
89
  - !ruby/object:Gem::Dependency
62
90
  name: minitest
63
91
  requirement: !ruby/object:Gem::Requirement
@@ -72,6 +100,20 @@ dependencies:
72
100
  - - ">="
73
101
  - !ruby/object:Gem::Version
74
102
  version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: mutex_m
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
75
117
  - !ruby/object:Gem::Dependency
76
118
  name: rake
77
119
  requirement: !ruby/object:Gem::Requirement
@@ -106,28 +148,28 @@ dependencies:
106
148
  requirements:
107
149
  - - "~>"
108
150
  - !ruby/object:Gem::Version
109
- version: 1.65.1
151
+ version: 1.66.1
110
152
  type: :development
111
153
  prerelease: false
112
154
  version_requirements: !ruby/object:Gem::Requirement
113
155
  requirements:
114
156
  - - "~>"
115
157
  - !ruby/object:Gem::Version
116
- version: 1.65.1
158
+ version: 1.66.1
117
159
  - !ruby/object:Gem::Dependency
118
160
  name: sqlite3
119
161
  requirement: !ruby/object:Gem::Requirement
120
162
  requirements:
121
163
  - - "~>"
122
164
  - !ruby/object:Gem::Version
123
- version: 1.6.0
165
+ version: '1.4'
124
166
  type: :development
125
167
  prerelease: false
126
168
  version_requirements: !ruby/object:Gem::Requirement
127
169
  requirements:
128
170
  - - "~>"
129
171
  - !ruby/object:Gem::Version
130
- version: 1.6.0
172
+ version: '1.4'
131
173
  description:
132
174
  email: michael@grosser.it
133
175
  executables:
@@ -153,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
195
  requirements:
154
196
  - - ">="
155
197
  - !ruby/object:Gem::Version
156
- version: 2.7.0
198
+ version: 3.1.0
157
199
  required_rubygems_version: !ruby/object:Gem::Requirement
158
200
  requirements:
159
201
  - - ">="