parallel_tests 3.5.2 → 3.6.0

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: 1d0652212f051b70b99ae872c05fb5ab37fbd5a13270d2158820555cd472a689
4
- data.tar.gz: 29c4e9cfbc3268880ce9ead6033e853588806503b0cc1bdfaf427ba6cd31b237
3
+ metadata.gz: 05ee67a0bc76b53a3da04722d4d0d1b2ab5d82373b40255edd3ece18f486e026
4
+ data.tar.gz: 2a3c9a39d71ccebe4d938f4005798c3aab95d5d9f9be6a8da50e1b4c5f474a6a
5
5
  SHA512:
6
- metadata.gz: b8cbab7441e101617611cb37908656c416d9901b4ca02cf85920de646b1c0e750e6c37ae4690be7ae8d4c79640db2e7505bcbd331d0c3072a1e60e1f0ff5b462
7
- data.tar.gz: 635508aa6168d0b7e58e8e932d61b079bc25135339c1adf4121707d4849cc9cedfc1acc134dce586112eac23f5e04f6083aeb133ccfb7505a42ea754ecc5f5ae
6
+ metadata.gz: d755fbc5e33402153ab3db7ca7f01ac035650b2f84ceb22c5d860bd824d2b1fe2e530b84a5266702f1089f55737f21d6b110255125cfbfa28074ad95e1a22eea
7
+ data.tar.gz: 74a6c4dd4c6a027113a59b1240b287906600adc00062a010462f0c4f3bb6934ba2b781a510844b8e9f5b0fee1d4de5e8523008b8b8b29e8ab520d6cbff593a90
@@ -23,16 +23,14 @@ module ParallelTests
23
23
 
24
24
  def with_pid_file
25
25
  Tempfile.open('parallel_tests-pidfile') do |f|
26
- begin
27
- ENV['PARALLEL_PID_FILE'] = f.path
28
- # Pids object should be created before threads will start adding pids to it
29
- # Otherwise we would have to use Mutex to prevent creation of several instances
30
- @pids = pids
31
- yield
32
- ensure
33
- ENV['PARALLEL_PID_FILE'] = nil
34
- @pids = nil
35
- end
26
+ ENV['PARALLEL_PID_FILE'] = f.path
27
+ # Pids object should be created before threads will start adding pids to it
28
+ # Otherwise we would have to use Mutex to prevent creation of several instances
29
+ @pids = pids
30
+ yield
31
+ ensure
32
+ ENV['PARALLEL_PID_FILE'] = nil
33
+ @pids = nil
36
34
  end
37
35
  end
38
36
 
@@ -105,13 +105,11 @@ module ParallelTests
105
105
 
106
106
  def lock(lockfile)
107
107
  File.open(lockfile) do |lock|
108
- begin
109
- lock.flock File::LOCK_EX
110
- yield
111
- ensure
112
- # This shouldn't be necessary, but appears to be
113
- lock.flock File::LOCK_UN
114
- end
108
+ lock.flock File::LOCK_EX
109
+ yield
110
+ ensure
111
+ # This shouldn't be necessary, but appears to be
112
+ lock.flock File::LOCK_UN
115
113
  end
116
114
  end
117
115
 
@@ -228,12 +226,10 @@ module ParallelTests
228
226
  opts.on("-e", "--exec [COMMAND]", "execute this code parallel and with ENV['TEST_ENV_NUMBER']") { |path| options[:execute] = path }
229
227
  opts.on("-o", "--test-options '[OPTIONS]'", "execute test commands with those options") { |arg| options[:test_options] = arg.lstrip }
230
228
  opts.on("-t", "--type [TYPE]", "test(default) / rspec / cucumber / spinach") do |type|
231
- begin
232
- @runner = load_runner(type)
233
- rescue NameError, LoadError => e
234
- puts "Runner for `#{type}` type has not been found! (#{e})"
235
- abort
236
- end
229
+ @runner = load_runner(type)
230
+ rescue NameError, LoadError => e
231
+ puts "Runner for `#{type}` type has not been found! (#{e})"
232
+ abort
237
233
  end
238
234
  opts.on(
239
235
  "--suffix [PATTERN]",
@@ -278,7 +274,14 @@ module ParallelTests
278
274
 
279
275
  files, remaining = extract_file_paths(argv)
280
276
  unless options[:execute]
281
- abort "Pass files or folders to run" unless files.any?
277
+ if files.empty?
278
+ default_test_folder = @runner.default_test_folder
279
+ if File.directory?(default_test_folder)
280
+ files = [default_test_folder]
281
+ else
282
+ abort "Pass files or folders to run"
283
+ end
284
+ end
282
285
  options[:files] = files.map { |file_path| Pathname.new(file_path).cleanpath.to_s }
283
286
  end
284
287
 
@@ -12,6 +12,10 @@ module ParallelTests
12
12
  'cucumber'
13
13
  end
14
14
 
15
+ def default_test_folder
16
+ 'features'
17
+ end
18
+
15
19
  def line_is_result?(line)
16
20
  super || line =~ SCENARIO_REGEX || line =~ SCENARIOS_RESULTS_BOUNDARY_REGEX
17
21
  end
@@ -34,6 +34,10 @@ module ParallelTests
34
34
  @test_file_name || 'feature'
35
35
  end
36
36
 
37
+ def default_test_folder
38
+ 'features'
39
+ end
40
+
37
41
  def test_suffix
38
42
  /\.feature$/
39
43
  end
@@ -26,6 +26,10 @@ module ParallelTests
26
26
  "tmp/parallel_runtime_rspec.log"
27
27
  end
28
28
 
29
+ def default_test_folder
30
+ "spec"
31
+ end
32
+
29
33
  def test_file_name
30
34
  "spec"
31
35
  end
@@ -9,6 +9,10 @@ module ParallelTests
9
9
  'spinach'
10
10
  end
11
11
 
12
+ def default_test_folder
13
+ 'features'
14
+ end
15
+
12
16
  def runtime_logging
13
17
  # Not Yet Supported
14
18
  ""
@@ -15,6 +15,10 @@ module ParallelTests
15
15
  /_(test|spec).rb$/
16
16
  end
17
17
 
18
+ def default_test_folder
19
+ "test"
20
+ end
21
+
18
22
  def test_file_name
19
23
  "test"
20
24
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ParallelTests
3
- VERSION = '3.5.2'
3
+ VERSION = '3.6.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.5.2
4
+ version: 3.6.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: 2021-03-08 00:00:00.000000000 Z
11
+ date: 2021-03-25 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.5.2/Readme.md
72
- source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.5.2
71
+ documentation_uri: https://github.com/grosser/parallel_tests/blob/v3.6.0/Readme.md
72
+ source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.6.0
73
73
  wiki_uri: https://github.com/grosser/parallel_tests/wiki
74
74
  post_install_message:
75
75
  rdoc_options: []
@@ -79,7 +79,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.4.0
82
+ version: 2.5.0
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - ">="