parallel_tests 5.3.0 → 5.4.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: a7a2c5d683029ce50e608bd13d0d3d7490f3c3bcd29180a311383c9c4ae8c698
4
- data.tar.gz: 6c779e00cf55b4bb34f740fb791b857b3ddeaaf42a5d595d207326184ddc0b91
3
+ metadata.gz: e291b4184f32301b51269a28e356e8047598be82dfb0549ef40fbe96a0538c1f
4
+ data.tar.gz: a8f8b7d081348692c324842fc31c1678a4cc91383aefc5f03bc008206c51ae75
5
5
  SHA512:
6
- metadata.gz: f363d5971f4a53180b4db97ec016b63a35e59dbf4d0416f71737e4b2e5e7c8c8aece067b45a80249123acf3c57761f6cf4daf12958ba00281e909122617e3eaf
7
- data.tar.gz: 4524b05659ca8b2468023adbb1c28f41be9738230295ec630a8d8b85f74e804143a3ad3c42dddaa9a95cd0111a3530374ef0f101714ee849f402bbecdb2614cf
6
+ metadata.gz: bc7c9e41c2f81f01b4d4fee20287d0fb2c7ec3eff5262fe8039b4d9c8421a50778e358e1fccaca3393c4e4b7c769c3013f352262c047df0556ce2e3aa0d91fe0
7
+ data.tar.gz: e0d5de320982072fb9ac14b5b6f25f055853d77b9c11d782cff4c63e8037513dbff4959cef02e14ab05dd632e2e7168265fabe2e69bc48ebc28590eeff26e325
data/Readme.md CHANGED
@@ -101,17 +101,23 @@ require "parallel_tests"
101
101
 
102
102
  # preparation:
103
103
  # affected by race-condition: first process may boot slower than the second
104
- # either sleep a bit or use a lock for example File.lock
105
- ParallelTests.first_process? ? do_something : sleep(1)
104
+ # the Process.ppid will be the pod of the process that started the parallel tests
105
+ # when not using TEST_ENV_NUMBER we use a unique file per process because ppid would be the users shell
106
+ done = "/tmp/parallel-setup-done-#{ENV['TEST_ENV_NUMBER'] ? Process.ppid : Process.pid}"
107
+ if ParallelTests.first_process?
108
+ do_something
109
+ File.write done, "true"
110
+ else
111
+ sleep 0.1 until File.exist?(done)
112
+ end
106
113
 
107
114
  # cleanup:
108
- # last_process? does NOT mean last finished process, just last started
109
- ParallelTests.last_process? ? do_something : sleep(1)
110
-
115
+ # could also use last_process? but that is just the last process to start, not the last to finish
111
116
  at_exit do
112
117
  if ParallelTests.first_process?
113
- ParallelTests.wait_for_other_processes_to_finish
114
- undo_something
118
+ File.unlink done
119
+ ParallelTests.wait_for_other_processes_to_finish
120
+ undo_something
115
121
  end
116
122
  end
117
123
  ```
@@ -354,6 +360,7 @@ TIPS
354
360
  - Debug errors that only happen with multiple files using `--verbose` and [cleanser](https://github.com/grosser/cleanser)
355
361
  - `export PARALLEL_TEST_PROCESSORS=13` to override default processor count
356
362
  - `export PARALLEL_TEST_MULTIPLY_PROCESSES=.5` to override default processor multiplier
363
+ - `export PARALLEL_RAILS_ENV=environment_name` to override the default `test` environment
357
364
  - Shell alias: `alias prspec='parallel_rspec -m 2 --'`
358
365
  - [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.
359
366
  - `--first-is-1` will make the first environment be `1`, so you can test while running your full suite.<br/>
@@ -468,6 +475,7 @@ inspired by [pivotal labs](https://blog.pivotal.io/labs/labs/parallelize-your-rs
468
475
  - [hatsu](https://github.com/hatsu38)
469
476
  - [Mark Huk](https://github.com/vimutter)
470
477
  - [Johannes Vetter](https://github.com/johvet)
478
+ - [Michel Filipe](https://github.com/mfilipe)
471
479
 
472
480
  [Michael Grosser](http://grosser.it)<br/>
473
481
  michael@grosser.it<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 = (num_processes * ParallelTests.determine_multiple(options[:multiply])).round
18
+ num_processes = (num_processes * ParallelTests.determine_multiple(options[:multiply_processes])).round
19
19
 
20
20
  options[:first_is_1] ||= first_is_1?
21
21
 
@@ -6,7 +6,7 @@ module ParallelTests
6
6
  module Tasks
7
7
  class << self
8
8
  def rails_env
9
- 'test'
9
+ ENV['PARALLEL_RAILS_ENV'] || 'test'
10
10
  end
11
11
 
12
12
  def load_lib
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ParallelTests
3
- VERSION = '5.3.0'
3
+ VERSION = '5.4.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.3.0
4
+ version: 5.4.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: 2025-05-30 00:00:00.000000000 Z
11
+ date: 2025-08-02 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/v5.3.0/CHANGELOG.md
73
- documentation_uri: https://github.com/grosser/parallel_tests/blob/v5.3.0/Readme.md
74
- source_code_uri: https://github.com/grosser/parallel_tests/tree/v5.3.0
72
+ changelog_uri: https://github.com/grosser/parallel_tests/blob/v5.4.0/CHANGELOG.md
73
+ documentation_uri: https://github.com/grosser/parallel_tests/blob/v5.4.0/Readme.md
74
+ source_code_uri: https://github.com/grosser/parallel_tests/tree/v5.4.0
75
75
  wiki_uri: https://github.com/grosser/parallel_tests/wiki
76
76
  rubygems_mfa_required: 'true'
77
77
  post_install_message: