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 +4 -4
- data/lib/parallel_tests.rb +8 -10
- data/lib/parallel_tests/cli.rb +17 -14
- data/lib/parallel_tests/cucumber/runner.rb +4 -0
- data/lib/parallel_tests/gherkin/runner.rb +4 -0
- data/lib/parallel_tests/rspec/runner.rb +4 -0
- data/lib/parallel_tests/spinach/runner.rb +4 -0
- data/lib/parallel_tests/test/runner.rb +4 -0
- data/lib/parallel_tests/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05ee67a0bc76b53a3da04722d4d0d1b2ab5d82373b40255edd3ece18f486e026
|
4
|
+
data.tar.gz: 2a3c9a39d71ccebe4d938f4005798c3aab95d5d9f9be6a8da50e1b4c5f474a6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d755fbc5e33402153ab3db7ca7f01ac035650b2f84ceb22c5d860bd824d2b1fe2e530b84a5266702f1089f55737f21d6b110255125cfbfa28074ad95e1a22eea
|
7
|
+
data.tar.gz: 74a6c4dd4c6a027113a59b1240b287906600adc00062a010462f0c4f3bb6934ba2b781a510844b8e9f5b0fee1d4de5e8523008b8b8b29e8ab520d6cbff593a90
|
data/lib/parallel_tests.rb
CHANGED
@@ -23,16 +23,14 @@ module ParallelTests
|
|
23
23
|
|
24
24
|
def with_pid_file
|
25
25
|
Tempfile.open('parallel_tests-pidfile') do |f|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -105,13 +105,11 @@ module ParallelTests
|
|
105
105
|
|
106
106
|
def lock(lockfile)
|
107
107
|
File.open(lockfile) do |lock|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
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
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
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
|
-
|
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
|
|
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.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-
|
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.
|
72
|
-
source_code_uri: https://github.com/grosser/parallel_tests/tree/v3.
|
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.
|
82
|
+
version: 2.5.0
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
85
|
- - ">="
|