flatware 0.4.0 → 0.4.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00a71ce8a23e22600391980c40aac3425a1efd27
4
- data.tar.gz: '082d74e5882c2cb99bfc4af567618e70817bb08d'
3
+ metadata.gz: 05e90320723eb9d0bcfb63d679ab20fefcf959d6
4
+ data.tar.gz: 246b6941233445b4049b195841a09a312ab688a5
5
5
  SHA512:
6
- metadata.gz: c591c042ab1bae59ba7e25309ceae39ca389f60b1d6f340882db31e3b0806e9acd0a8dfaa512e5529a2f1f636c297c9ba5335e247d3de3b65b90e3929b2adbf3
7
- data.tar.gz: 33043b7af9e2d929e7a99c8e53c127ac9bbc4bb366f78e74ae32e53432980d64bb2b61aa7eecf818b2611df25da68d12c0ff975a463125b35748c4227d22ab16
6
+ metadata.gz: 85b3f22abdd35c210aee7063073ac27b6fe77d8db1ac7488dea8ee62ea11fab16eccbbef10b57d049833ec3b49ba388a9719c003d9241287d0a03b7ebcf2992c
7
+ data.tar.gz: 62e93337c7304ec941196dfc5d959e0bbc20acdda6dc45ea136b6748bc6cb61809b8e5943f842dfed521dd27b6fd9d6db4a7fc4e40cf2d8881ffb2f6911792a8
data/README.md CHANGED
@@ -25,11 +25,18 @@ sudo apt-get install -qq libzmq3-dev
25
25
 
26
26
  #### Mac OSX
27
27
 
28
- Ruby FFI isn't getting along with the latest ZMQ formula. A tweaked verson is available in the Hashrocket tap.
28
+
29
+ If you're on macOS 10.12, use the custom hashrocket ZMQ homebrew formula.
29
30
 
30
31
  ```sh
31
32
  brew tap hashrocket/formulas
32
33
  brew install hashrocket/formulas/zeromq
34
+ ```
35
+
36
+ The stock homebrew version will likely work on older versions of macOS.
37
+
38
+
39
+ ```sh
33
40
  brew install zeromq
34
41
  ```
35
42
 
@@ -38,8 +45,8 @@ brew install zeromq
38
45
  Add the runners you need to your Gemfile:
39
46
 
40
47
  ```ruby
41
- gem 'flatware-rspec' # one
42
- gem 'flatware-cucumber' # or both
48
+ gem 'flatware-rspec', require: false # one
49
+ gem 'flatware-cucumber', require: false # or both
43
50
  ```
44
51
 
45
52
  then run
@@ -1,5 +1,6 @@
1
1
  module Flatware
2
2
  require 'flatware/processor_info'
3
+ require 'flatware/job'
3
4
  require 'flatware/cli'
4
5
  require 'flatware/poller'
5
6
  require 'flatware/sink'
@@ -1,5 +1,4 @@
1
1
  require 'cucumber'
2
- require 'flatware/cucumber/checkpoint'
3
2
  require 'flatware/cucumber/formatter'
4
3
  require 'flatware/cucumber/result'
5
4
  require 'flatware/cucumber/scenario_result'
@@ -1,6 +1,5 @@
1
1
  require 'cucumber/formatter/console'
2
2
  require 'flatware/cucumber/formatters/console'
3
- require 'flatware/cucumber/checkpoint'
4
3
 
5
4
  module Flatware::Cucumber::Formatters
6
5
  class Console
@@ -0,0 +1,10 @@
1
+ module Flatware
2
+ Job = Struct.new :id, :args do
3
+ attr_accessor :worker
4
+ attr_writer :failed
5
+
6
+ def failed?
7
+ !!@failed
8
+ end
9
+ end
10
+ end
@@ -1,8 +1,6 @@
1
1
  require 'rspec/core/notifications'
2
2
  module Flatware
3
3
  module RSpec
4
- Summary = Struct.new(:duration, :examples, :failed_examples, :pending_examples, :load_time)
5
-
6
4
  class Example
7
5
  attr_reader :location_rerun_argument, :full_description
8
6
  def initialize(rspec_example)
@@ -11,21 +9,9 @@ module Flatware
11
9
  end
12
10
  end
13
11
 
14
- class Summary
12
+ class Summary < ::RSpec::Core::Notifications::SummaryNotification
15
13
  def +(other)
16
- self.class.new duration + other.duration,
17
- examples + other.examples,
18
- failed_examples + other.failed_examples,
19
- pending_examples + other.pending_examples,
20
- load_time + other.load_time
21
- end
22
-
23
- def fully_formatted
24
- ::RSpec::Core::Notifications::SummaryNotification.new(duration, examples, failed_examples, pending_examples, load_time).fully_formatted
25
- end
26
-
27
- def failure_count
28
- failed_examples.size
14
+ self.class.new(*zip(other).map {|a,b| a + b})
29
15
  end
30
16
 
31
17
  def self.from_notification(summary)
@@ -33,7 +19,7 @@ module Flatware
33
19
  examples.map(&Example.method(:new))
34
20
  end
35
21
 
36
- new summary.duration, *serialized_examples, summary.load_time
22
+ new summary.duration, *serialized_examples, *summary.to_a[4..-1]
37
23
  end
38
24
  end
39
25
  end
@@ -5,15 +5,6 @@ require 'logger'
5
5
  module Flatware
6
6
  Error = Class.new StandardError
7
7
 
8
- Job = Struct.new :id, :args do
9
- attr_accessor :worker
10
- attr_writer :failed
11
-
12
- def failed?
13
- !!@failed
14
- end
15
- end
16
-
17
8
  extend self
18
9
 
19
10
  def logger
@@ -38,8 +29,8 @@ module Flatware
38
29
  close force: true
39
30
  end
40
31
 
41
- def socket_error
42
- raise(Error, ZMQ::Util.error_string, caller) unless @ignore_errors
32
+ def socket_error(name=nil)
33
+ raise(Error, [$0,name,ZMQ::Util.error_string].compact.join(' - '), caller) unless @ignore_errors
43
34
  end
44
35
 
45
36
  def log(*message)
@@ -88,7 +79,7 @@ module Flatware
88
79
  socket.setsockopt ZMQ::LINGER, 0
89
80
  end if force
90
81
  sockets.each(&:close)
91
- Flatware::socket_error unless c.terminate == 0
82
+ Flatware::socket_error unless LibZMQ.zmq_term(c.context) == 0
92
83
  Flatware.log "terminated context"
93
84
  end
94
85
  end
@@ -110,7 +101,7 @@ module Flatware
110
101
 
111
102
  def send(message)
112
103
  result = socket.send_string(Marshal.dump(message))
113
- Flatware::socket_error if result == -1
104
+ error if result == -1
114
105
  Flatware.log "#@type #@port send #{message}"
115
106
  message
116
107
  end
@@ -118,7 +109,7 @@ module Flatware
118
109
  def connect(port)
119
110
  @type = 'connected'
120
111
  @port = port
121
- Flatware::socket_error unless socket.connect(port) == 0
112
+ error unless socket.connect(port) == 0
122
113
  Flatware.log "connect #@port"
123
114
  end
124
115
 
@@ -154,20 +145,24 @@ module Flatware
154
145
  def bind(port)
155
146
  @type = 'bound'
156
147
  @port = port
157
- Flatware::socket_error unless socket.bind(port) == 0
148
+ error unless socket.bind(port) == 0
158
149
  Flatware.log "bind #@port"
159
150
  end
160
151
 
161
152
  def close
162
- Flatware::socket_error unless socket.close == 0
153
+ error unless socket.close == 0
163
154
  Flatware.log "close #@type #@port"
164
155
  end
165
156
 
157
+ def error
158
+ Flatware::socket_error name
159
+ end
160
+
166
161
  def recv(block: true, marshal: true)
167
162
  message = ''
168
163
  if block
169
164
  result = socket.recv_string(message)
170
- Flatware::socket_error if result == -1
165
+ error if result == -1
171
166
  else
172
167
  socket.recv_string(message, ZMQ::NOBLOCK)
173
168
  end
@@ -1,3 +1,3 @@
1
1
  module Flatware
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
@@ -48,7 +48,7 @@ module Flatware
48
48
 
49
49
  private
50
50
 
51
- attr_reader :fireable, :task, :sink, :runner
51
+ attr_reader :task, :sink, :runner
52
52
 
53
53
  def report_for_duty
54
54
  task.send [:ready, id]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flatware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dunn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-27 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi-rzmq
@@ -84,7 +84,6 @@ files:
84
84
  - lib/flatware/broadcaster.rb
85
85
  - lib/flatware/cli.rb
86
86
  - lib/flatware/cucumber.rb
87
- - lib/flatware/cucumber/checkpoint.rb
88
87
  - lib/flatware/cucumber/cli.rb
89
88
  - lib/flatware/cucumber/formatter.rb
90
89
  - lib/flatware/cucumber/formatters/console.rb
@@ -93,6 +92,7 @@ files:
93
92
  - lib/flatware/cucumber/runtime.rb
94
93
  - lib/flatware/cucumber/scenario_result.rb
95
94
  - lib/flatware/cucumber/step_result.rb
95
+ - lib/flatware/job.rb
96
96
  - lib/flatware/pids.rb
97
97
  - lib/flatware/poller.rb
98
98
  - lib/flatware/processor_info.rb
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.6.8
133
+ rubygems_version: 2.6.14
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: A distributed cucumber and rspec runner
@@ -1,28 +0,0 @@
1
- module Flatware
2
- module Cucumber
3
- class Checkpoint
4
- attr_reader :steps, :scenarios
5
- def initialize(steps, scenarios)
6
- @steps, @scenarios = serialize_steps(steps), serialize_scenarios(scenarios)
7
- end
8
-
9
- def failures?
10
- scenarios.any? &:failed?
11
- end
12
-
13
- private
14
-
15
- def serialize_steps(steps)
16
- steps.map do |step|
17
- StepResult.new step.status, step.exception
18
- end
19
- end
20
-
21
- def serialize_scenarios(scenarios)
22
- scenarios.map do |scenario|
23
- ScenarioResult.new scenario.status, scenario.file_colon_line, scenario.name, scenario.exception
24
- end
25
- end
26
- end
27
- end
28
- end