parallel_tests 4.2.1 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9044c95c595a48f89a621563c609a4c9fa89d851792ca694a30fcaf947a2119
4
- data.tar.gz: 248e38e467b9070c1666819e2c1dc9149b791644b42e8a90cd53df82ebb80eed
3
+ metadata.gz: 8669ce686a0c750d7bb0cbcab2f78ddd1d2431bcb5eb3eeea3a1a9050efe345e
4
+ data.tar.gz: a7f4d4148379cee9f80a820b72ce04e91eaf8df697cc9db8c2d530225e519f67
5
5
  SHA512:
6
- metadata.gz: 363e8d317a43d03043a270c19d05f60071bd05a9b435a0545454e81b96d875b694dd4fadc74669ba136990d57d863883132a19ff7fd1c9c4169e2c16a8e2db38
7
- data.tar.gz: ef251fa00adf1310c5281ee4985119ce6b4810d121d87a3a4a7f6b6a03aa968ed9be7847eec127e74a118983e4454b181635d1538b1a17b5f242fbb11839caa9
6
+ metadata.gz: 49a18035b13cb9d5665d73eec21bcc0749ae09b1488d05dc86bfc2516a6303b8e95919ec73ffc648d1aa7f5be373b1c70e8691d69719aaff79c382879db2c6c5
7
+ data.tar.gz: 5f0c59c7e8ba42150396e48cf31d437b0b9ce15b20c4554ae23072e00d3b9a8b48de41fd102f17275ca1015e151482b691159d6d10cebe9139106ad8183f2828
data/Readme.md CHANGED
@@ -228,7 +228,9 @@ Options are:
228
228
  Process 1 will contain 1_spec.rb and 2_spec.rb
229
229
  Process 2 will contain 3_spec.rb
230
230
  Process 3 will contain all other specs
231
- --only-group INT[,INT]
231
+ --only-group INT[,INT] Only run the given group numbers. Note that this will force the 'filesize'
232
+ grouping strategy (even when the runtime log is present) unless you explicitly
233
+ set it otherwise via the '-group-by' flag.
232
234
  -e, --exec [COMMAND] execute this code parallel and with ENV['TEST_ENV_NUMBER']
233
235
  -o, --test-options '[OPTIONS]' execute test commands with those options
234
236
  -t, --type [TYPE] test(default) / rspec / cucumber / spinach
@@ -244,7 +244,14 @@ module ParallelTests
244
244
  TEXT
245
245
  ) { |groups| options[:specify_groups] = groups }
246
246
 
247
- opts.on("--only-group INT[,INT]", Array) { |groups| options[:only_group] = groups.map(&:to_i) }
247
+ opts.on(
248
+ "--only-group INT[,INT]",
249
+ Array,
250
+ <<~TEXT.rstrip.split("\n").join("\n#{newline_padding}")
251
+ Only run the given group numbers.
252
+ Changes `--group-by` default to 'filesize'.
253
+ TEXT
254
+ ) { |groups| options[:only_group] = groups.map(&:to_i) }
248
255
 
249
256
  opts.on("-e", "--exec [COMMAND]", "execute this code parallel and with ENV['TEST_ENV_NUMBER']") { |arg| options[:execute] = Shellwords.shellsplit(arg) }
250
257
  opts.on("-o", "--test-options '[OPTIONS]'", "execute test commands with those options") { |arg| options[:test_options] = Shellwords.shellsplit(arg) }
@@ -258,7 +265,7 @@ module ParallelTests
258
265
  "--suffix [PATTERN]",
259
266
  <<~TEXT.rstrip.split("\n").join("\n#{newline_padding}")
260
267
  override built in test file pattern (should match suffix):
261
- '_spec\.rb$' - matches rspec files
268
+ '_spec.rb$' - matches rspec files
262
269
  '_(test|spec).rb$' - matches test or spec files
263
270
  TEXT
264
271
  ) { |pattern| options[:suffix] = /#{pattern}/ }
@@ -3,22 +3,14 @@ require 'parallel_tests/rspec/logger_base'
3
3
  require 'parallel_tests/rspec/runner'
4
4
 
5
5
  class ParallelTests::RSpec::FailuresLogger < ParallelTests::RSpec::LoggerBase
6
- if RSPEC_2
7
- def dump_failures(*args); end
8
- else
9
- RSpec::Core::Formatters.register self, :dump_summary
10
- end
6
+ RSpec::Core::Formatters.register(self, :dump_summary)
11
7
 
12
8
  def dump_summary(*args)
13
9
  lock_output do
14
- if RSPEC_2
15
- dump_commands_to_rerun_failed_examples
16
- else
17
- notification = args.first
18
- unless notification.failed_examples.empty?
19
- colorizer = ::RSpec::Core::Formatters::ConsoleCodes
20
- output.puts notification.colorized_rerun_commands(colorizer)
21
- end
10
+ notification = args.first
11
+ unless notification.failed_examples.empty?
12
+ colorizer = ::RSpec::Core::Formatters::ConsoleCodes
13
+ output.puts notification.colorized_rerun_commands(colorizer)
22
14
  end
23
15
  end
24
16
  @output.flush
@@ -7,8 +7,6 @@ end
7
7
  require 'rspec/core/formatters/base_text_formatter'
8
8
 
9
9
  class ParallelTests::RSpec::LoggerBase < RSpec::Core::Formatters::BaseTextFormatter
10
- RSPEC_2 = RSpec::Core::Version::STRING.start_with?('2')
11
-
12
10
  def initialize(*args)
13
11
  super
14
12
 
@@ -9,7 +9,7 @@ class ParallelTests::RSpec::RuntimeLogger < ParallelTests::RSpec::LoggerBase
9
9
  @group_nesting = 0
10
10
  end
11
11
 
12
- RSpec::Core::Formatters.register self, :example_group_started, :example_group_finished, :start_dump unless RSPEC_2
12
+ RSpec::Core::Formatters.register(self, :example_group_started, :example_group_finished, :start_dump)
13
13
 
14
14
  def example_group_started(example_group)
15
15
  @time = ParallelTests.now if @group_nesting == 0
@@ -20,8 +20,7 @@ class ParallelTests::RSpec::RuntimeLogger < ParallelTests::RSpec::LoggerBase
20
20
  def example_group_finished(notification)
21
21
  @group_nesting -= 1
22
22
  if @group_nesting == 0
23
- path = (RSPEC_2 ? notification.file_path : notification.group.file_path)
24
- @example_times[path] += ParallelTests.now - @time
23
+ @example_times[notification.group.file_path] += ParallelTests.now - @time
25
24
  end
26
25
  super if defined?(super)
27
26
  end
@@ -39,7 +38,7 @@ class ParallelTests::RSpec::RuntimeLogger < ParallelTests::RSpec::LoggerBase
39
38
  lock_output do
40
39
  @example_times.each do |file, time|
41
40
  relative_path = file.sub(%r{^#{Regexp.escape Dir.pwd}/}, '').sub(%r{^\./}, "")
42
- @output.puts "#{relative_path}:#{time > 0 ? time : 0}"
41
+ @output.puts "#{relative_path}:#{[time, 0].max}"
43
42
  end
44
43
  end
45
44
  @output.flush
@@ -2,7 +2,7 @@
2
2
  require 'parallel_tests/rspec/failures_logger'
3
3
 
4
4
  class ParallelTests::RSpec::SummaryLogger < ParallelTests::RSpec::LoggerBase
5
- RSpec::Core::Formatters.register self, :dump_failures unless RSPEC_2
5
+ RSpec::Core::Formatters.register(self, :dump_failures)
6
6
 
7
7
  def dump_failures(*args)
8
8
  lock_output { super }
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ParallelTests
3
- VERSION = '4.2.1'
3
+ VERSION = '4.2.2'
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: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-12 00:00:00.000000000 Z
11
+ date: 2023-09-06 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/v4.2.1/Readme.md
72
- source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.2.1
71
+ documentation_uri: https://github.com/grosser/parallel_tests/blob/v4.2.2/Readme.md
72
+ source_code_uri: https://github.com/grosser/parallel_tests/tree/v4.2.2
73
73
  wiki_uri: https://github.com/grosser/parallel_tests/wiki
74
74
  post_install_message:
75
75
  rdoc_options: []