parallel_cucumber 0.2.20 → 0.2.21
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 +4 -4
- data/lib/parallel_cucumber/cli.rb +0 -12
- data/lib/parallel_cucumber/dsl.rb +4 -0
- data/lib/parallel_cucumber/hooks.rb +17 -5
- data/lib/parallel_cucumber/version.rb +1 -1
- data/lib/parallel_cucumber/worker.rb +1 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2a5fcb6c187e21abd99851009a31c5015221e31118e5e16ccbb022467f64614
|
4
|
+
data.tar.gz: f45853fb7908faa80978b52c7e8208b2cec406a4dad87c80949623e615870dcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21f7385b3c24476db0de9b9890d0e47166cd2ab3d4d5a5c52e8a73e39bc97e58502c50c0faaf4c82f0e250bda4ebe86a401a6b40c5f84b71959f058a9c6bfecb
|
7
|
+
data.tar.gz: eaeb5edcda79f778eb6b3bf1c0af1bfdabe69137422724a79523e9f0288c5e3e8177cfb30b920c227173ffcdf4644272772fb112ac46a214a3d3423a2709d0e9
|
@@ -8,7 +8,6 @@ module ParallelCucumber
|
|
8
8
|
batch_size: 1,
|
9
9
|
batch_timeout: 600,
|
10
10
|
setup_timeout: 30,
|
11
|
-
precheck_timeout: 30,
|
12
11
|
batch_error_timeout: 30,
|
13
12
|
cucumber_options: '',
|
14
13
|
debug: false,
|
@@ -90,10 +89,6 @@ module ParallelCucumber
|
|
90
89
|
options[:test_command] = test_command
|
91
90
|
end
|
92
91
|
|
93
|
-
opts.on('--pre-batch-check COMMAND', 'Command causing worker to quit on exit failure') do |pre_check|
|
94
|
-
options[:pre_check] = pre_check
|
95
|
-
end
|
96
|
-
|
97
92
|
opts.on('--log-dir DIR', 'Directory for worker logfiles') do |log_dir|
|
98
93
|
options[:log_dir] = log_dir
|
99
94
|
end
|
@@ -173,13 +168,6 @@ module ParallelCucumber
|
|
173
168
|
options[:batch_timeout] = batch_timeout
|
174
169
|
end
|
175
170
|
|
176
|
-
help_message = <<-TEXT.gsub(/\s+/, ' ').strip
|
177
|
-
Timeout for each test precheck. Default is #{DEFAULTS[:batch_timeout]}
|
178
|
-
TEXT
|
179
|
-
opts.on('--precheck-timeout SECONDS', Float, help_message) do |timeout|
|
180
|
-
options[:precheck_timeout] = timeout
|
181
|
-
end
|
182
|
-
|
183
171
|
help_message = <<-TEXT.gsub(/\s+/, ' ').strip
|
184
172
|
Timeout for each batch_error script. Default is #{DEFAULTS[:batch_error_timeout]}
|
185
173
|
TEXT
|
@@ -1,12 +1,18 @@
|
|
1
1
|
module ParallelCucumber
|
2
2
|
class Hooks
|
3
|
-
@
|
4
|
-
@
|
5
|
-
@
|
6
|
-
@
|
7
|
-
@
|
3
|
+
@worker_health_check ||= []
|
4
|
+
@before_batch_hooks ||= []
|
5
|
+
@after_batch_hooks ||= []
|
6
|
+
@before_workers ||= []
|
7
|
+
@after_workers ||= []
|
8
|
+
@on_batch_error ||= []
|
8
9
|
|
9
10
|
class << self
|
11
|
+
def register_worker_health_check(proc)
|
12
|
+
raise(ArgumentError, 'Please provide a valid callback') unless proc.respond_to?(:call)
|
13
|
+
@worker_health_check << proc
|
14
|
+
end
|
15
|
+
|
10
16
|
def register_before_batch(proc)
|
11
17
|
raise(ArgumentError, 'Please provide a valid callback') unless proc.respond_to?(:call)
|
12
18
|
@before_batch_hooks << proc
|
@@ -32,6 +38,12 @@ module ParallelCucumber
|
|
32
38
|
@on_batch_error << proc
|
33
39
|
end
|
34
40
|
|
41
|
+
def fire_worker_health_check(*args)
|
42
|
+
@worker_health_check.each do |hook|
|
43
|
+
hook.call(*args)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
35
47
|
def fire_before_batch_hooks(*args)
|
36
48
|
@before_batch_hooks.each do |hook|
|
37
49
|
hook.call(*args)
|
@@ -10,11 +10,9 @@ module ParallelCucumber
|
|
10
10
|
@group_by = options[:group_by]
|
11
11
|
@batch_timeout = options[:batch_timeout]
|
12
12
|
@batch_error_timeout = options[:batch_error_timeout]
|
13
|
-
@precheck_timeout = options[:precheck_timeout]
|
14
13
|
@setup_timeout = options[:setup_timeout]
|
15
14
|
@cucumber_options = options[:cucumber_options]
|
16
15
|
@test_command = options[:test_command]
|
17
|
-
@pre_check = options[:pre_check]
|
18
16
|
@index = index
|
19
17
|
@name = "W#{@index}"
|
20
18
|
@setup_worker = options[:setup_worker]
|
@@ -99,12 +97,7 @@ module ParallelCucumber
|
|
99
97
|
job = @jobs_queue.pop(false)
|
100
98
|
case job.type
|
101
99
|
when Job::PRECHECK
|
102
|
-
|
103
|
-
if (m = precmd.match(/precmd:retry-after-(\d+)-seconds/))
|
104
|
-
@manager.inform_idle(@name)
|
105
|
-
sleep(1 + m[1].to_i)
|
106
|
-
next
|
107
|
-
end
|
100
|
+
Hooks.fire_worker_health_check(env)
|
108
101
|
@manager.inform_healthy(@name)
|
109
102
|
when Job::RUN_TESTS
|
110
103
|
run_batch(env, results, running_total, job.details)
|
@@ -161,18 +154,6 @@ module ParallelCucumber
|
|
161
154
|
@logger.update_into(@stdout_logger)
|
162
155
|
end
|
163
156
|
|
164
|
-
def precheck(env)
|
165
|
-
return 'default no-op pre_check' unless @pre_check
|
166
|
-
begin
|
167
|
-
return Helper::Command.exec_command(
|
168
|
-
env, 'precheck', @pre_check, @logger, @log_decoration, timeout: @precheck_timeout, capture: true
|
169
|
-
)
|
170
|
-
rescue
|
171
|
-
@logger.error('Pre-check failed: quitting immediately')
|
172
|
-
raise 'Pre-check failed: quitting immediately'
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
157
|
def running_totals(batch_results, running_total)
|
177
158
|
batch_info = Status.constants.map do |status|
|
178
159
|
status = Status.const_get(status)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parallel_cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Bayandin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|