parallel_tests 5.7.0 → 5.8.0

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: f1e67ef9a02b33a054474fc052eb824f47220fd9da0451990e324269007f317a
4
- data.tar.gz: fae078645fa22ef747f19cfd302151df284a493977f8c791fa8b6c05c4419a7c
3
+ metadata.gz: '092bd037e5c9728f7274bddb7490af927fca7c80f2504d79f23b3344da77c39b'
4
+ data.tar.gz: 6562747c26170da4848f852ca7ef76fbd9cff2378899f0ec1b88302de9046aa9
5
5
  SHA512:
6
- metadata.gz: 5a124362dbf263564e987bbfef5538c0c6de8233aa35113cacf4eb51d773051d28f07bde7d12148fd07f9c39d5d4b6ab6d5e30d99a851b973e2b820e7dd5c4a4
7
- data.tar.gz: 46c6e22f663dc9140c408d1424a576181d9de81d463925fc65d70bd5ee3a118f4eb6f3b078077e944d1f1b4c80b761442de5d20c76dbb8af701ab7f9bdfcfa3a
6
+ metadata.gz: 81ae4c12dc1e4dbd17c3b52d7b0d7b0e46ea74f97e54a467029576f550a51ecf4ba4809c473c86a82ba2bf6325ea08cd260a9e14c64a27b0785fb6f0aa1f86d6
7
+ data.tar.gz: 82a9c37846b5eed1eb39f07d4fbab82b1aeb820d643f3713b080ff28d62777c4b74b9ce7ec20e187c27b111ce4c031c1c490cfad3cce854bc9c9245041e7c582
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Michael Grosser
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/Readme.md CHANGED
@@ -257,18 +257,19 @@ Options are:
257
257
  --isolate-n PROCESSES Use 'isolate' singles with number of processes, default: 1
258
258
  --highest-exit-status Exit with the highest exit status provided by test run(s)
259
259
  --failure-exit-code INT Specify the exit code to use when tests fail
260
- --specify-groups SPECS Use 'specify-groups' if you want to specify multiple specs running in multiple
261
- processes in a specific formation. Commas indicate specs in the same process,
262
- pipes indicate specs in a new process. If SPECS is a '-' the value for this
263
- option is read from STDIN instead. Cannot use with --single, --isolate, or
264
- --isolate-n. Ex.
265
- $ parallel_tests -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb'
266
- Process 1 will contain 1_spec.rb and 2_spec.rb
267
- Process 2 will contain 3_spec.rb
268
- Process 3 will contain all other specs
260
+ --specify-groups SPECS Specify multiple specs running in multiple processes in a given formation.
261
+ Commas separates specs in the same process, pipes separate processes.
262
+ Spec not mentioned are run in a separate process.
263
+ With '-' the value is read from STDIN.
264
+ Cannot use with --single, --isolate, or --isolate-n.
265
+ parallel_tests -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb'
266
+ Process 1 = 1_spec.rb + 2_spec.rb, Process 2 = 3_spec.rb, Process 3 = remainder
269
267
  --only-group GROUP_INDEX[,GROUP_INDEX]
270
- Only run the given group numbers.
271
- Changes `--group-by` default to 'filesize'.
268
+ Only run the given group numbers. Changes `--group-by` default to 'filesize'.
269
+ --only-group-continuous-test-env
270
+ Instead of resetting `ENV['TEST_ENV_NUMBER']` when using `--only-group`, the env matches the group index`.
271
+ Use when running in parallel with shared resources.
272
+ Requires `--only-group`.
272
273
  -e, --exec COMMAND execute COMMAND in parallel and with ENV['TEST_ENV_NUMBER']
273
274
  --exec-args COMMAND execute COMMAND in parallel with test files as arguments, for example:
274
275
  $ parallel_tests --exec-args echo
@@ -82,6 +82,11 @@ module ParallelTests
82
82
 
83
83
  report_number_of_tests(groups) unless options[:quiet]
84
84
  test_results = execute_in_parallel(groups, groups.size, options) do |group, index|
85
+ if options[:only_group] && options[:only_group_continuous_test_env]
86
+ # Here's where we "sync" the index. Since only_group is numerical, we need `- 1` to make it an index
87
+ # e.g. --only-group=1,4 should yield index 0 & 3 instead of 0 & 1
88
+ index = options[:only_group][index] - 1
89
+ end
85
90
  run_tests(group, index, num_processes, options)
86
91
  end
87
92
  report_results(test_results, options) unless options[:quiet]
@@ -256,28 +261,33 @@ module ParallelTests
256
261
  opts.on(
257
262
  "--specify-groups SPECS",
258
263
  heredoc(<<~TEXT, newline_padding)
259
- Use 'specify-groups' if you want to specify multiple specs running in multiple
260
- processes in a specific formation. Commas indicate specs in the same process,
261
- pipes indicate specs in a new process. If SPECS is a '-' the value for this
262
- option is read from STDIN instead. Cannot use with --single, --isolate, or
263
- --isolate-n. Ex.
264
- $ parallel_tests -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb'
265
- Process 1 will contain 1_spec.rb and 2_spec.rb
266
- Process 2 will contain 3_spec.rb
267
- Process 3 will contain all other specs
264
+ Specify multiple specs running in multiple processes in a given formation.
265
+ Commas separates specs in the same process, pipes separate processes.
266
+ Spec not mentioned are run in a separate process.
267
+ With '-' the value is read from STDIN.
268
+ Cannot use with --single, --isolate, or --isolate-n.
269
+ parallel_tests -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb'
270
+ Process 1 = 1_spec.rb + 2_spec.rb, Process 2 = 3_spec.rb, Process 3 = remainder
268
271
  TEXT
269
272
  ) { |groups| options[:specify_groups] = groups }
270
273
 
271
274
  opts.on(
272
275
  "--only-group GROUP_INDEX[,GROUP_INDEX]",
273
276
  Array,
277
+ "Only run the given group numbers. Changes `--group-by` default to 'filesize'."
278
+ ) { |groups| options[:only_group] = groups.map(&:to_i) }
279
+
280
+ opts.on(
281
+ "--only-group-continuous-test-env",
274
282
  heredoc(<<~TEXT, newline_padding)
275
- Only run the given group numbers.
276
- Changes `--group-by` default to 'filesize'.
283
+ Instead of resetting `ENV['TEST_ENV_NUMBER']` when using `--only-group`, the env matches the group index`.
284
+ Use when running in parallel with shared resources.
285
+ Requires `--only-group`.
277
286
  TEXT
278
- ) { |groups| options[:only_group] = groups.map(&:to_i) }
287
+ ) { options[:only_group_continuous_test_env] = true }
279
288
 
280
289
  opts.on("-e", "--exec COMMAND", "execute COMMAND in parallel and with ENV['TEST_ENV_NUMBER']") { |arg| options[:execute] = Shellwords.shellsplit(arg) }
290
+
281
291
  opts.on(
282
292
  "--exec-args COMMAND",
283
293
  heredoc(<<~TEXT, newline_padding)
@@ -334,16 +344,20 @@ module ParallelTests
334
344
  opts.on("--verbose-process-command", "Print the command that will be executed by each process before it begins") { options[:verbose_process_command] = true }
335
345
  opts.on("--verbose-rerun-command", "After a process fails, print the command executed by that process") { options[:verbose_rerun_command] = true }
336
346
  opts.on("--quiet", "Print only tests output") { options[:quiet] = true }
347
+
337
348
  opts.on("-v", "--version", "Show Version") do
338
349
  puts ParallelTests::VERSION
339
350
  exit 0
340
351
  end
352
+
341
353
  opts.on("-h", "--help", "Show this.") do
342
354
  puts opts
343
355
  exit 0
344
356
  end
345
357
  end.parse!(argv)
346
358
 
359
+ raise "--only-group is required for --only-group-continuous-test-env" if options[:only_group_continuous_test_env] && !options[:only_group]
360
+
347
361
  raise "Both options are mutually exclusive: verbose & quiet" if options[:verbose] && options[:quiet]
348
362
 
349
363
  if options[:count] == 0
@@ -375,6 +389,9 @@ module ParallelTests
375
389
  if !allowed.include?(options[:group_by]) && options[:only_group]
376
390
  raise "--group-by #{allowed.join(" or ")} is required for --only-group"
377
391
  end
392
+ if options[:only_group]&.any? { |g| g <= 0 }
393
+ raise '--only-group should be >= 0'
394
+ end
378
395
 
379
396
  if options[:specify_groups] && options.keys.intersect?([:single_process, :isolate, :isolate_count])
380
397
  raise "Can't pass --specify-groups with any of these keys: --single, --isolate, or --isolate-n"
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ParallelTests
3
- VERSION = '5.7.0'
3
+ VERSION = '5.8.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel_tests
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.7.0
4
+ version: 5.8.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: 2026-04-09 00:00:00.000000000 Z
11
+ date: 2026-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -34,6 +34,7 @@ executables:
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
+ - LICENSE
37
38
  - Readme.md
38
39
  - bin/parallel_cucumber
39
40
  - bin/parallel_rspec
@@ -69,9 +70,9 @@ licenses:
69
70
  - MIT
70
71
  metadata:
71
72
  bug_tracker_uri: https://github.com/grosser/parallel_tests/issues
72
- changelog_uri: https://github.com/grosser/parallel_tests/blob/v5.7.0/CHANGELOG.md
73
- documentation_uri: https://github.com/grosser/parallel_tests/blob/v5.7.0/Readme.md
74
- source_code_uri: https://github.com/grosser/parallel_tests/tree/v5.7.0
73
+ changelog_uri: https://github.com/grosser/parallel_tests/blob/v5.8.0/CHANGELOG.md
74
+ documentation_uri: https://github.com/grosser/parallel_tests/blob/v5.8.0/Readme.md
75
+ source_code_uri: https://github.com/grosser/parallel_tests/tree/v5.8.0
75
76
  wiki_uri: https://github.com/grosser/parallel_tests/wiki
76
77
  rubygems_mfa_required: 'true'
77
78
  post_install_message:
@@ -82,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
83
  requirements:
83
84
  - - ">="
84
85
  - !ruby/object:Gem::Version
85
- version: 3.1.0
86
+ version: 3.2.0
86
87
  required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  requirements:
88
89
  - - ">="