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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0580e1b5fc70be0e585aaaecfaf3fc601977ef1d63c6d3bca8ec9e1ea1cae505'
4
- data.tar.gz: 7a8f041ceb5b3f05e9e92ecbe4945d79ccfab02a7addd8341649a3cedc6767b1
3
+ metadata.gz: 1cc7f77b415e6c3dfecc724f2158484d6c7efa738d44aeaa09c8c38d3f21294f
4
+ data.tar.gz: ff13071ef1923827aae116b89774da871bac2a57a8c4c0a7efedd1dea0fbaee1
5
5
  SHA512:
6
- metadata.gz: fc736a86fc1c2a27adb549ea85c2fb591c4b4ec5fca0e4e03e6b32f3ed06b76201340bf729ce5974cf5c2b99613fe01ddba7532bc95e9a6e6bc0f0362f4a33ad
7
- data.tar.gz: eae8e7192c80c5872123905b18dd754c52cafc0f9de88dd185d1f4f7306d68e592487d44601f178c4c77690027762d05b6d10096610f4086ef1c4d996a9d9369
6
+ metadata.gz: bca9398fd557444f9bee0b8eb362fa6fd885d89fd8d923393642ecac772ce8ef05338ca879c08e226f27549d67797bcac7211b37302d0e1cbae45f933a69d81b
7
+ data.tar.gz: b29bf809e2c174edaaa5d11c62dc8c705fcab415246bff9bd5652708aff03a4aca26f1e88d6ede4383ca257083adacfcc5ab65adb9bd74992d264b6476a39b4c
@@ -23,6 +23,10 @@ module ParallelCucumber
23
23
  Hooks.register_after_batch(proc)
24
24
  end
25
25
 
26
+ def before_workers(&proc)
27
+ Hooks.register_before_workers(proc)
28
+ end
29
+
26
30
  def after_workers(&proc)
27
31
  Hooks.register_after_workers(proc)
28
32
  end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ParallelCucumber
2
- VERSION = '0.2.14'.freeze
2
+ VERSION = '0.2.15'.freeze
3
3
  end
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.14
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-03-15 00:00:00.000000000 Z
11
+ date: 2019-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber