parallel_tests 4.9.0 → 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 +4 -4
- data/Readme.md +2 -0
- data/lib/parallel_tests/cli.rb +3 -3
- data/lib/parallel_tests/cucumber/failures_logger.rb +16 -7
- data/lib/parallel_tests/version.rb +1 -1
- data/lib/parallel_tests.rb +19 -5
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a4f5446b6d6db5c736415039a356984675cf0abf750f20bbe3a91f0b3735009
|
4
|
+
data.tar.gz: 50bd6ad7de1fb31d2acdeb9e0ab1b90615318024754c868a6a7d71d53cd09d62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/>
|
@@ -447,6 +448,7 @@ inspired by [pivotal labs](https://blog.pivotal.io/labs/labs/parallelize-your-rs
|
|
447
448
|
- [Josh Westbrook](https://github.com/joshwestbrook)
|
448
449
|
- [Jay Dorsey](https://github.com/jaydorsey)
|
449
450
|
- [hatsu](https://github.com/hatsu38)
|
451
|
+
- [Mark Huk](https://github.com/vimutter)
|
450
452
|
|
451
453
|
[Michael Grosser](http://grosser.it)<br/>
|
452
454
|
michael@grosser.it<br/>
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -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
|
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 |
|
224
|
-
options[:
|
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,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'cucumber/formatter/rerun'
|
3
3
|
require 'parallel_tests/gherkin/io'
|
4
|
+
require 'cucumber/events'
|
4
5
|
|
5
6
|
module ParallelTests
|
6
7
|
module Cucumber
|
@@ -9,15 +10,23 @@ module ParallelTests
|
|
9
10
|
|
10
11
|
def initialize(config)
|
11
12
|
super
|
13
|
+
|
12
14
|
@io = prepare_io(config.out_stream)
|
13
|
-
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
# Remove handler inherited from Cucumber::Formatter::Rerun that does not
|
17
|
+
# properly join file failures
|
18
|
+
handlers = config.event_bus.instance_variable_get(:@handlers)
|
19
|
+
handlers[::Cucumber::Events::TestRunFinished.to_s].pop
|
20
|
+
|
21
|
+
# Add our own handler
|
22
|
+
config.on_event :test_run_finished do
|
23
|
+
return if @failures.empty?
|
24
|
+
|
25
|
+
lock_output do
|
26
|
+
@failures.each do |file, lines|
|
27
|
+
lines.each do |line|
|
28
|
+
@io.print "#{file}:#{line} "
|
29
|
+
end
|
21
30
|
end
|
22
31
|
end
|
23
32
|
end
|
data/lib/parallel_tests.rb
CHANGED
@@ -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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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.
|
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-01
|
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.
|
73
|
-
documentation_uri: https://github.com/grosser/parallel_tests/blob/v4.
|
74
|
-
source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.
|
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:
|