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 +4 -4
- data/README.md +10 -3
- data/lib/flatware.rb +1 -0
- data/lib/flatware/cucumber.rb +0 -1
- data/lib/flatware/cucumber/formatters/console/summary.rb +0 -1
- data/lib/flatware/job.rb +10 -0
- data/lib/flatware/rspec/summary.rb +3 -17
- data/lib/flatware/socket.rb +12 -17
- data/lib/flatware/version.rb +1 -1
- data/lib/flatware/worker.rb +1 -1
- metadata +4 -4
- data/lib/flatware/cucumber/checkpoint.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05e90320723eb9d0bcfb63d679ab20fefcf959d6
|
4
|
+
data.tar.gz: 246b6941233445b4049b195841a09a312ab688a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/flatware.rb
CHANGED
data/lib/flatware/cucumber.rb
CHANGED
data/lib/flatware/job.rb
ADDED
@@ -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
|
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.
|
22
|
+
new summary.duration, *serialized_examples, *summary.to_a[4..-1]
|
37
23
|
end
|
38
24
|
end
|
39
25
|
end
|
data/lib/flatware/socket.rb
CHANGED
@@ -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.
|
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
|
-
|
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
|
-
|
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
|
-
|
148
|
+
error unless socket.bind(port) == 0
|
158
149
|
Flatware.log "bind #@port"
|
159
150
|
end
|
160
151
|
|
161
152
|
def close
|
162
|
-
|
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
|
-
|
165
|
+
error if result == -1
|
171
166
|
else
|
172
167
|
socket.recv_string(message, ZMQ::NOBLOCK)
|
173
168
|
end
|
data/lib/flatware/version.rb
CHANGED
data/lib/flatware/worker.rb
CHANGED
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.
|
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:
|
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.
|
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
|