parallel_tests 4.9.1 → 4.10.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: 7e815835eed992c081181431f2989b1ab60ec6a0a3c95947c90aafd5db2ebcd3
4
- data.tar.gz: 2b70b55f1d6c8fd5980bd7373cc3d2848ff895223a55f58b669d07fe1aa396e6
3
+ metadata.gz: 2a4f5446b6d6db5c736415039a356984675cf0abf750f20bbe3a91f0b3735009
4
+ data.tar.gz: 50bd6ad7de1fb31d2acdeb9e0ab1b90615318024754c868a6a7d71d53cd09d62
5
5
  SHA512:
6
- metadata.gz: abbcf1ba23afba1f7d0e055d37f924ba4bd3d3e77c09a4a78a725d17158bb0553daf3ca739c41035c9d3833cd0413a40e304decf05ebe00f453ed35865c90193
7
- data.tar.gz: 4dafcef1701e3584dae080953282b52733066bdc1415fa50aa2dc67bd91f292471dd9ff32939fdef16867226ee46aa94a6272e7705371900f320b1f196e38f95
6
+ metadata.gz: 2a02874f4956c27c4d83465b785ce0bd44c6b0c8bc27eae97e8fc1076c791bf1a4be3d78c1898b9477f0bc827dd9101dbd31e686fa597a6c5f93cc04cf97db4e
7
+ data.tar.gz: f116b1a783843f93a04f835930968d2db17ae0279f8b7d3a4406c8412e36cc32dbedfd655b0756eb4477e9536c59f60f4d7ff359e090267eff35308b0e979867
data/Readme.md CHANGED
@@ -335,6 +335,7 @@ TIPS
335
335
  e.g. `config.cache_store = ..., namespace: "test_#{ENV['TEST_ENV_NUMBER']}"`
336
336
  - Debug errors that only happen with multiple files using `--verbose` and [cleanser](https://github.com/grosser/cleanser)
337
337
  - `export PARALLEL_TEST_PROCESSORS=13` to override default processor count
338
+ - `export PARALLEL_TEST_MULTIPLE=.5` to override default processor multiplier
338
339
  - Shell alias: `alias prspec='parallel_rspec -m 2 --'`
339
340
  - [Spring] Add the [spring-commands-parallel-tests](https://github.com/DocSpring/spring-commands-parallel-tests) gem to your `Gemfile` to get `parallel_tests` working with Spring.
340
341
  - `--first-is-1` will make the first environment be `1`, so you can test while running your full suite.<br/>
@@ -15,7 +15,7 @@ module ParallelTests
15
15
  ENV['DISABLE_SPRING'] ||= '1'
16
16
 
17
17
  num_processes = ParallelTests.determine_number_of_processes(options[:count])
18
- num_processes *= (options[:multiply] || 1)
18
+ num_processes = (num_processes * ParallelTests.determine_multiple(options[:multiply])).round
19
19
 
20
20
  options[:first_is_1] ||= first_is_1?
21
21
 
@@ -220,8 +220,8 @@ module ParallelTests
220
220
  default - runtime when runtime log is filled otherwise filesize
221
221
  TEXT
222
222
  ) { |type| options[:group_by] = type.to_sym }
223
- opts.on("-m COUNT", "--multiply-processes COUNT", Float, "use given number as a multiplier of processes to run") do |multiply|
224
- options[:multiply] = multiply
223
+ opts.on("-m COUNT", "--multiply-processes COUNT", Float, "use given number as a multiplier of processes to run") do |m|
224
+ options[:multiply_processes] = m
225
225
  end
226
226
 
227
227
  opts.on("-s PATTERN", "--single PATTERN", "Run all matching files in the same process") do |pattern|
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ParallelTests
3
- VERSION = '4.9.1'
3
+ VERSION = '4.10.1'
4
4
  end
@@ -6,6 +6,7 @@ require "rbconfig"
6
6
  module ParallelTests
7
7
  WINDOWS = (RbConfig::CONFIG['host_os'] =~ /cygwin|mswin|mingw|bccwin|wince|emx/)
8
8
  RUBY_BINARY = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
9
+ DEFAULT_MULTIPLY_PROCESSES = 1.0
9
10
 
10
11
  autoload :CLI, "parallel_tests/cli"
11
12
  autoload :VERSION, "parallel_tests/version"
@@ -13,12 +14,25 @@ module ParallelTests
13
14
  autoload :Pids, "parallel_tests/pids"
14
15
 
15
16
  class << self
17
+ # used by external libraries, do not rename or change api
16
18
  def determine_number_of_processes(count)
17
- [
18
- count,
19
- ENV["PARALLEL_TEST_PROCESSORS"],
20
- Parallel.processor_count
21
- ].detect { |c| !c.to_s.strip.empty? }.to_i
19
+ Integer(
20
+ [
21
+ count,
22
+ ENV["PARALLEL_TEST_PROCESSORS"],
23
+ Parallel.processor_count
24
+ ].detect { |c| !c.to_s.strip.empty? }
25
+ )
26
+ end
27
+
28
+ def determine_multiple(multiple)
29
+ Float(
30
+ [
31
+ multiple,
32
+ ENV["PARALLEL_TEST_MULTIPLY_PROCESSES"],
33
+ DEFAULT_MULTIPLY_PROCESSES
34
+ ].detect { |c| !c.to_s.strip.empty? }
35
+ )
22
36
  end
23
37
 
24
38
  def with_pid_file
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: 4.9.1
4
+ version: 4.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-19 00:00:00.000000000 Z
11
+ date: 2025-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel
@@ -69,9 +69,9 @@ licenses:
69
69
  - MIT
70
70
  metadata:
71
71
  bug_tracker_uri: https://github.com/grosser/parallel_tests/issues
72
- changelog_uri: https://github.com/grosser/parallel_tests/blob/v4.9.1/CHANGELOG.md
73
- documentation_uri: https://github.com/grosser/parallel_tests/blob/v4.9.1/Readme.md
74
- source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.9.1
72
+ changelog_uri: https://github.com/grosser/parallel_tests/blob/v4.10.1/CHANGELOG.md
73
+ documentation_uri: https://github.com/grosser/parallel_tests/blob/v4.10.1/Readme.md
74
+ source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.10.1
75
75
  wiki_uri: https://github.com/grosser/parallel_tests/wiki
76
76
  rubygems_mfa_required: 'true'
77
77
  post_install_message: