parallel_cucumber 0.2.14 → 0.2.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/parallel_cucumber/dsl.rb +4 -0
- data/lib/parallel_cucumber/hooks.rb +12 -0
- data/lib/parallel_cucumber/main.rb +7 -0
- data/lib/parallel_cucumber/version.rb +1 -1
- 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: 1cc7f77b415e6c3dfecc724f2158484d6c7efa738d44aeaa09c8c38d3f21294f
|
4
|
+
data.tar.gz: ff13071ef1923827aae116b89774da871bac2a57a8c4c0a7efedd1dea0fbaee1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bca9398fd557444f9bee0b8eb362fa6fd885d89fd8d923393642ecac772ce8ef05338ca879c08e226f27549d67797bcac7211b37302d0e1cbae45f933a69d81b
|
7
|
+
data.tar.gz: b29bf809e2c174edaaa5d11c62dc8c705fcab415246bff9bd5652708aff03a4aca26f1e88d6ede4383ca257083adacfcc5ab65adb9bd74992d264b6476a39b4c
|
@@ -2,6 +2,7 @@ module ParallelCucumber
|
|
2
2
|
class Hooks
|
3
3
|
@before_batch_hooks ||= []
|
4
4
|
@after_batch_hooks ||= []
|
5
|
+
@before_workers ||= []
|
5
6
|
@after_workers ||= []
|
6
7
|
@on_batch_error ||= []
|
7
8
|
|
@@ -16,6 +17,11 @@ module ParallelCucumber
|
|
16
17
|
@after_batch_hooks << proc
|
17
18
|
end
|
18
19
|
|
20
|
+
def register_before_workers(proc)
|
21
|
+
raise(ArgumentError, 'Please provide a valid callback') unless proc.respond_to?(:call)
|
22
|
+
@before_workers << proc
|
23
|
+
end
|
24
|
+
|
19
25
|
def register_after_workers(proc)
|
20
26
|
raise(ArgumentError, 'Please provide a valid callback') unless proc.respond_to?(:call)
|
21
27
|
@after_workers << proc
|
@@ -38,6 +44,12 @@ module ParallelCucumber
|
|
38
44
|
end
|
39
45
|
end
|
40
46
|
|
47
|
+
def fire_before_workers(*args)
|
48
|
+
@before_workers.each do |hook|
|
49
|
+
hook.call(*args)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
41
53
|
def fire_after_workers(*args)
|
42
54
|
@after_workers.each do |hook|
|
43
55
|
hook.call(*args)
|
@@ -75,6 +75,13 @@ module ParallelCucumber
|
|
75
75
|
|
76
76
|
status_totals = {}
|
77
77
|
total_mm, total_ss = time_it do
|
78
|
+
begin
|
79
|
+
Hooks.fire_before_workers(queue: queue)
|
80
|
+
rescue StandardError => e
|
81
|
+
trace = e.backtrace.join("\n\t")
|
82
|
+
@logger.warn("There was exception in before_workers hook #{e.message} \n #{trace}")
|
83
|
+
end
|
84
|
+
|
78
85
|
results = run_parallel_workers(number_of_workers) || {}
|
79
86
|
|
80
87
|
begin
|
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.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Bayandin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|