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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 777189ca793239a4c1f468a50d69c3518047cb5ea72432521fd99ab8b9a7b61c
4
- data.tar.gz: 47b6fad3f42ab691d29ed8037cb0025d318ef791b90769aafc86edf8ca88cb1f
3
+ metadata.gz: 6dc1e8ae73baee388849755336a036d94026c85e097253397df2a47e7332b468
4
+ data.tar.gz: a28ea801be1d14fa7ec47c5793ecfb835881b0d19268b0ac83621b3ab8ebafe8
5
5
  SHA512:
6
- metadata.gz: a473918b8acb6391550a1a2a5d4f7a261994aea2937b37ad927b73282b4c9a9d61a3d9a656ce429abeb76321ae9a2a3ee084fb962c4bb026e8692712b9b8b9ce
7
- data.tar.gz: 75d3625ec3b6f89cdd3b8a7463b156de059cabd5da49b3bbd4797b413e35ee0cd9955f0274a289f09d82293b19ae9ae084a371b67cba3c2a2cc22fc5e3a52057
6
+ metadata.gz: 0075ef8c1a7387397f21a7471f96b54bf6548e54a8d2724de47b50610991b95386ddb85c3ccf65b36611dd331fa713219832385ead8f336a8cc6cf9454b36d3e
7
+ data.tar.gz: cf68aa64bb77bc69cb2e49f1c5e83a97e73fb221ed50e9e5f002dad7e87567d5790eee0efad605e57d503c033fa53b9978d2535090cc03ba14f15d28e11d2974
@@ -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
- $ parallel_tests -n 3 . --specify-groups '1_spec.rb,2_spec.rb|3_spec.rb'
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
@@ -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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ParallelTests
3
- VERSION = '3.10.1'
3
+ VERSION = '3.11.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: 3.10.1
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-24 00:00:00.000000000 Z
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.10.1/Readme.md
72
- source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.10.1
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: []