parallel_tests 3.2.0 → 3.3.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 +4 -4
- data/Readme.md +3 -1
- data/lib/parallel_tests/cli.rb +6 -0
- data/lib/parallel_tests/grouper.rb +32 -5
- data/lib/parallel_tests/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 630376174bbe4941703500d82264c43c0a8b42c3a490b1df9dbe174de6fb58a3
|
4
|
+
data.tar.gz: 2e37c805bb3ef70476ffb9e9e9881d8f6467741bee4146e27a3ab04542c68f23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5efe758f85900c7990d52c31b1f1aa3b1f6ab3e2939a3318eeddc275c6efa8d218d7d137efd61cfe5c701a225b3cf74a676690eef949c2033942baa13f6c3972
|
7
|
+
data.tar.gz: 434ac657ff8c2f9f5c253cc784ee0de49119391ef195b834a77e9b82b7b485b6f536c9207addfe9e08f09e2026ffd9410db4fdb373498989ff9d5fb1ed003757
|
data/Readme.md
CHANGED
@@ -205,7 +205,9 @@ Options are:
|
|
205
205
|
default - runtime when runtime log is filled otherwise filesize
|
206
206
|
-m, --multiply-processes [FLOAT] use given number as a multiplier of processes to run
|
207
207
|
-s, --single [PATTERN] Run all matching files in the same process
|
208
|
-
-i, --isolate Do not run any other tests in the group used by --single(-s)
|
208
|
+
-i, --isolate Do not run any other tests in the group used by --single(-s).
|
209
|
+
Automatically turned on if --isolate-n is set above 0.
|
210
|
+
--isolate-n Number of processes for isolated groups. Default to 1 when --isolate is on.
|
209
211
|
--only-group INT[, INT]
|
210
212
|
-e, --exec [COMMAND] execute this code parallel and with ENV['TEST_ENV_NUMBER']
|
211
213
|
-o, --test-options '[OPTIONS]' execute test commands with those options
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -192,6 +192,12 @@ module ParallelTests
|
|
192
192
|
options[:isolate] = true
|
193
193
|
end
|
194
194
|
|
195
|
+
opts.on("--isolate-n [PROCESSES]",
|
196
|
+
Integer,
|
197
|
+
"Use 'isolate' singles with number of processes, default: 1.") do |n|
|
198
|
+
options[:isolate_count] = n
|
199
|
+
end
|
200
|
+
|
195
201
|
opts.on("--only-group INT[, INT]", Array) { |groups| options[:only_group] = groups.map(&:to_i) }
|
196
202
|
|
197
203
|
opts.on("-e", "--exec [COMMAND]", "execute this code parallel and with ENV['TEST_ENV_NUMBER']") { |path| options[:execute] = path }
|
@@ -15,19 +15,46 @@ module ParallelTests
|
|
15
15
|
groups = Array.new(num_groups) { {:items => [], :size => 0} }
|
16
16
|
|
17
17
|
# add all files that should run in a single process to one group
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
single_process_patterns = options[:single_process] || []
|
19
|
+
|
20
|
+
single_items, items = items.partition do |item, _size|
|
21
|
+
single_process_patterns.any? { |pattern| item =~ pattern }
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
|
-
|
24
|
+
isolate_count = isolate_count(options)
|
25
|
+
|
26
|
+
if isolate_count >= num_groups
|
27
|
+
raise 'Number of isolated processes must be less than total the number of processes'
|
28
|
+
end
|
29
|
+
|
30
|
+
if isolate_count >= 1
|
31
|
+
# add all files that should run in a multiple isolated processes to their own groups
|
32
|
+
group_features_by_size(items_to_group(single_items), groups[0..(isolate_count - 1)])
|
33
|
+
# group the non-isolated by size
|
34
|
+
group_features_by_size(items_to_group(items), groups[isolate_count..-1])
|
35
|
+
else
|
36
|
+
# add all files that should run in a single non-isolated process to first group
|
37
|
+
single_items.each { |item, size| add_to_group(groups.first, item, size) }
|
38
|
+
|
39
|
+
# group all by size
|
40
|
+
group_features_by_size(items_to_group(items), groups)
|
41
|
+
end
|
25
42
|
|
26
43
|
groups.map! { |g| g[:items].sort }
|
27
44
|
end
|
28
45
|
|
29
46
|
private
|
30
47
|
|
48
|
+
def isolate_count(options)
|
49
|
+
if options[:isolate_count] && options[:isolate_count] > 1
|
50
|
+
options[:isolate_count]
|
51
|
+
elsif options[:isolate]
|
52
|
+
1
|
53
|
+
else
|
54
|
+
0
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
31
58
|
def largest_first(files)
|
32
59
|
files.sort_by{|_item, size| size }.reverse
|
33
60
|
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: 3.
|
4
|
+
version: 3.3.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: 2020-
|
11
|
+
date: 2020-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -68,8 +68,8 @@ licenses:
|
|
68
68
|
- MIT
|
69
69
|
metadata:
|
70
70
|
bug_tracker_uri: https://github.com/grosser/parallel_tests/issues
|
71
|
-
documentation_uri: https://github.com/grosser/parallel_tests/blob/v3.
|
72
|
-
source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.
|
71
|
+
documentation_uri: https://github.com/grosser/parallel_tests/blob/v3.3.0/Readme.md
|
72
|
+
source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.3.0
|
73
73
|
wiki_uri: https://github.com/grosser/parallel_tests/wiki
|
74
74
|
post_install_message:
|
75
75
|
rdoc_options: []
|