parallel_tests 3.10.1 → 3.11.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/lib/parallel_tests/cli.rb +1 -1
- data/lib/parallel_tests/tasks.rb +24 -18
- data/lib/parallel_tests/test/runner.rb +3 -1
- 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: 6dc1e8ae73baee388849755336a036d94026c85e097253397df2a47e7332b468
|
4
|
+
data.tar.gz: a28ea801be1d14fa7ec47c5793ecfb835881b0d19268b0ac83621b3ab8ebafe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0075ef8c1a7387397f21a7471f96b54bf6548e54a8d2724de47b50610991b95386ddb85c3ccf65b36611dd331fa713219832385ead8f336a8cc6cf9454b36d3e
|
7
|
+
data.tar.gz: cf68aa64bb77bc69cb2e49f1c5e83a97e73fb221ed50e9e5f002dad7e87567d5790eee0efad605e57d503c033fa53b9978d2535090cc03ba14f15d28e11d2974
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -228,7 +228,7 @@ module ParallelTests
|
|
228
228
|
processes in a specific formation. Commas indicate specs in the same process,
|
229
229
|
pipes indicate specs in a new process. Cannot use with --single, --isolate, or
|
230
230
|
--isolate-n. Ex.
|
231
|
-
$
|
231
|
+
$ parallel_test -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb'
|
232
232
|
Process 1 will contain 1_spec.rb and 2_spec.rb
|
233
233
|
Process 2 will contain 3_spec.rb
|
234
234
|
Process 3 will contain all other specs
|
data/lib/parallel_tests/tasks.rb
CHANGED
@@ -102,6 +102,29 @@ module ParallelTests
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
def build_run_command(type, args)
|
106
|
+
count, pattern, options, pass_through = ParallelTests::Tasks.parse_args(args)
|
107
|
+
test_framework = {
|
108
|
+
'spec' => 'rspec',
|
109
|
+
'test' => 'test',
|
110
|
+
'features' => 'cucumber',
|
111
|
+
'features-spinach' => 'spinach'
|
112
|
+
}.fetch(type)
|
113
|
+
|
114
|
+
type = 'features' if test_framework == 'spinach'
|
115
|
+
|
116
|
+
# Using the relative path to find the binary allow to run a specific version of it
|
117
|
+
executable = File.expand_path('../../bin/parallel_test', __dir__)
|
118
|
+
executable = ParallelTests.with_ruby_binary(executable)
|
119
|
+
|
120
|
+
command = [*executable, type, '--type', test_framework]
|
121
|
+
command += ['-n', count.to_s] if count
|
122
|
+
command += ['--pattern', pattern] if pattern
|
123
|
+
command += ['--test-options', options] if options
|
124
|
+
command += Shellwords.shellsplit pass_through if pass_through
|
125
|
+
command
|
126
|
+
end
|
127
|
+
|
105
128
|
private
|
106
129
|
|
107
130
|
def rails_7_or_greater?
|
@@ -237,24 +260,7 @@ namespace :parallel do
|
|
237
260
|
task type, [:count, :pattern, :options, :pass_through] do |_t, args|
|
238
261
|
ParallelTests::Tasks.check_for_pending_migrations
|
239
262
|
ParallelTests::Tasks.load_lib
|
240
|
-
|
241
|
-
count, pattern, options, pass_through = ParallelTests::Tasks.parse_args(args)
|
242
|
-
test_framework = {
|
243
|
-
'spec' => 'rspec',
|
244
|
-
'test' => 'test',
|
245
|
-
'features' => 'cucumber',
|
246
|
-
'features-spinach' => 'spinach'
|
247
|
-
}.fetch(type)
|
248
|
-
|
249
|
-
type = 'features' if test_framework == 'spinach'
|
250
|
-
# Using the relative path to find the binary allow to run a specific version of it
|
251
|
-
executable = File.expand_path('../../bin/parallel_test', __dir__)
|
252
|
-
|
253
|
-
command = [*ParallelTests.with_ruby_binary(executable), type, '--type', test_framework]
|
254
|
-
command += ['-n', count.to_s] if count
|
255
|
-
command += ['--pattern', pattern] if pattern
|
256
|
-
command += ['--test-options', options] if options
|
257
|
-
command += Shellwords.shellsplit pass_through if pass_through
|
263
|
+
command = ParallelTests::Tasks.build_run_command(type, args)
|
258
264
|
|
259
265
|
abort unless system(*command) # allow to chain tasks e.g. rake parallel:spec parallel:features
|
260
266
|
end
|
@@ -5,6 +5,8 @@ require 'parallel_tests'
|
|
5
5
|
module ParallelTests
|
6
6
|
module Test
|
7
7
|
class Runner
|
8
|
+
RuntimeLogTooSmallError = Class.new(StandardError)
|
9
|
+
|
8
10
|
class << self
|
9
11
|
# --- usually overwritten by other runners
|
10
12
|
|
@@ -199,7 +201,7 @@ module ParallelTests
|
|
199
201
|
allowed_missing -= 1 unless time = runtimes[test]
|
200
202
|
if allowed_missing < 0
|
201
203
|
log = options[:runtime_log] || runtime_log
|
202
|
-
raise "Runtime log file '#{log}' does not contain sufficient data to sort #{tests.size} test files, please update or remove it."
|
204
|
+
raise RuntimeLogTooSmallError, "Runtime log file '#{log}' does not contain sufficient data to sort #{tests.size} test files, please update or remove it."
|
203
205
|
end
|
204
206
|
[test, time]
|
205
207
|
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.11.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: 2022-05-
|
11
|
+
date: 2022-05-27 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.11.0/Readme.md
|
72
|
+
source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.11.0
|
73
73
|
wiki_uri: https://github.com/grosser/parallel_tests/wiki
|
74
74
|
post_install_message:
|
75
75
|
rdoc_options: []
|