parallel_tests 2.16.1 → 2.17.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 +4 -0
- data/lib/parallel_tests/cli.rb +13 -0
- data/lib/parallel_tests/pids.rb +5 -5
- data/lib/parallel_tests/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1f4bfdd3a1b255d2f95ad98dc11564cc137fe08
|
4
|
+
data.tar.gz: b273836c89a6e65c756797a52994bdd6f4078376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c326454b909a928bd01295ced39cc7e7ef7a9cd411422cc6c869f07cc77787e4050e816e17f9d923d740f31d285e942942cfc2e21ec0610614ed645098c21bae
|
7
|
+
data.tar.gz: a8e3a767d91ca441f8c9adf5fb1f2f16498cde3bee2f556e56196962e67f10af4c078aa3b30081291ec6ca78ff2d2e5c8ddc8080ae08344a7626c6e55863cdb7
|
data/lib/parallel_tests.rb
CHANGED
@@ -28,6 +28,10 @@ module ParallelTests
|
|
28
28
|
ENV['PARALLEL_PID_FILE'] ||= Tempfile.new('parallel-tests-pidfile').path
|
29
29
|
end
|
30
30
|
|
31
|
+
def stop_all_processes
|
32
|
+
pids.all.each { |pid| Process.kill(:INT, pid) }
|
33
|
+
end
|
34
|
+
|
31
35
|
# copied from http://github.com/carlhuda/bundler Bundler::SharedHelpers#find_gemfile
|
32
36
|
def bundler_enabled?
|
33
37
|
return true if Object.const_defined?(:Bundler)
|
data/lib/parallel_tests/cli.rb
CHANGED
@@ -6,6 +6,8 @@ require 'shellwords'
|
|
6
6
|
module ParallelTests
|
7
7
|
class CLI
|
8
8
|
def run(argv)
|
9
|
+
Signal.trap("INT") { handle_interrupt }
|
10
|
+
|
9
11
|
options = parse_options!(argv)
|
10
12
|
|
11
13
|
ENV['DISABLE_SPRING'] ||= '1'
|
@@ -24,6 +26,17 @@ module ParallelTests
|
|
24
26
|
|
25
27
|
private
|
26
28
|
|
29
|
+
def handle_interrupt
|
30
|
+
@graceful_shutdown_attempted ||= false
|
31
|
+
Kernel.exit if @graceful_shutdown_attempted
|
32
|
+
|
33
|
+
# The Pid class's synchronize method can't be called directly from a trap
|
34
|
+
# Using Thread workaround https://github.com/ddollar/foreman/issues/332
|
35
|
+
Thread.new { ParallelTests.stop_all_processes }
|
36
|
+
|
37
|
+
@graceful_shutdown_attempted = true
|
38
|
+
end
|
39
|
+
|
27
40
|
def execute_in_parallel(items, num_processes, options)
|
28
41
|
Tempfile.open 'parallel_tests-lock' do |lock|
|
29
42
|
progress_indicator = simulate_output_for_ci if options[:serialize_stdout]
|
data/lib/parallel_tests/pids.rb
CHANGED
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: 2.
|
4
|
+
version: 2.17.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: 2017-10-
|
11
|
+
date: 2017-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|