blade 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/index.coffee +9 -6
- data/lib/blade.rb +4 -4
- data/lib/blade/combined_test_results.rb +3 -3
- data/lib/blade/interface/ci.rb +2 -2
- data/lib/blade/interface/runner/tab.rb +11 -11
- data/lib/blade/server.rb +2 -1
- data/lib/blade/test_results.rb +8 -9
- data/lib/blade/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3b7b89ebef6e891ac308f65cf9935faf057482f
|
4
|
+
data.tar.gz: bfa25e592269250f945798b9403331a741486fa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff881b9e9aca8302fe4a646588b9cc31bad686a867b4ad42772c6d38bef819d02d43e293e6af75a349426d4e0705141228014c70b86bd1805849206d3bab3a66
|
7
|
+
data.tar.gz: c386316e4c95d86ddbb2e55e2e71852ef5e8db88429b6c26c08b5c12eafca99c8747d4d3623cee6c9d83984321806069c7b1e5988dc114bef4e9fe3e52af9275
|
data/assets/index.coffee
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
@Blade =
|
2
|
-
suiteDidBegin: (
|
3
|
-
|
2
|
+
suiteDidBegin: ({total}) ->
|
3
|
+
event = "begin"
|
4
|
+
publish("/tests", {event, total})
|
4
5
|
|
5
|
-
testDidEnd: (
|
6
|
-
|
6
|
+
testDidEnd: ({name, status, message}) ->
|
7
|
+
event = "result"
|
8
|
+
publish("/tests", {event, name, status, message})
|
7
9
|
|
8
|
-
suiteDidEnd: (
|
9
|
-
|
10
|
+
suiteDidEnd: ({total}) ->
|
11
|
+
event = "end"
|
12
|
+
publish("/tests", {event, total})
|
10
13
|
|
11
14
|
publish = (channel, data = {}) ->
|
12
15
|
client.publish(channel, copy(data, {session_id})) if session_id?
|
data/lib/blade.rb
CHANGED
@@ -83,14 +83,14 @@ module Blade
|
|
83
83
|
|
84
84
|
private
|
85
85
|
def handle_exit
|
86
|
-
%w( INT ).each do |signal|
|
87
|
-
trap(signal) { stop }
|
88
|
-
end
|
89
|
-
|
90
86
|
at_exit do
|
91
87
|
stop
|
92
88
|
exit $!.status if $!.is_a?(SystemExit)
|
93
89
|
end
|
90
|
+
|
91
|
+
%w( INT ).each do |signal|
|
92
|
+
trap(signal) { exit(1) }
|
93
|
+
end
|
94
94
|
end
|
95
95
|
|
96
96
|
def load_config_file!
|
@@ -24,7 +24,7 @@ class Blade::CombinedTestResults
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def failed?
|
27
|
-
|
27
|
+
states.include?("failed")
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
@@ -36,7 +36,7 @@ class Blade::CombinedTestResults
|
|
36
36
|
all_test_results.map(&:total).compact
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
all_test_results.map(&:
|
39
|
+
def states
|
40
|
+
all_test_results.map(&:state)
|
41
41
|
end
|
42
42
|
end
|
data/lib/blade/interface/ci.rb
CHANGED
@@ -6,16 +6,16 @@ class Blade::Runner::Tab < Blade::Model
|
|
6
6
|
extend Forwardable
|
7
7
|
def_delegators "Blade::Runner", :create_window
|
8
8
|
|
9
|
-
attr_reader :window, :
|
9
|
+
attr_reader :window, :state_window, :content_window
|
10
10
|
|
11
11
|
def install(options = {})
|
12
12
|
top = options[:top]
|
13
13
|
@window = create_window(top: top, height: 3)
|
14
14
|
|
15
15
|
top = @window.begy + @window.maxy + 1
|
16
|
-
@
|
16
|
+
@state_window = create_window(top: top, height: 1)
|
17
17
|
|
18
|
-
top = @
|
18
|
+
top = @state_window.begy + @state_window.maxy + 1
|
19
19
|
@content_window = create_window(top: top)
|
20
20
|
@content_window.scrollok(true)
|
21
21
|
end
|
@@ -93,7 +93,7 @@ class Blade::Runner::Tab < Blade::Model
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def dot
|
96
|
-
|
96
|
+
state == "pending" ? "○" : "●"
|
97
97
|
end
|
98
98
|
|
99
99
|
def index
|
@@ -104,8 +104,8 @@ class Blade::Runner::Tab < Blade::Model
|
|
104
104
|
Blade::Session.find(id)
|
105
105
|
end
|
106
106
|
|
107
|
-
def
|
108
|
-
session.test_results.
|
107
|
+
def state
|
108
|
+
session.test_results.state
|
109
109
|
end
|
110
110
|
|
111
111
|
def active?
|
@@ -122,8 +122,8 @@ class Blade::Runner::Tab < Blade::Model
|
|
122
122
|
self.active = true
|
123
123
|
draw
|
124
124
|
|
125
|
-
tabs.
|
126
|
-
tabs.
|
125
|
+
tabs.state_window.addstr(session.to_s)
|
126
|
+
tabs.state_window.noutrefresh
|
127
127
|
|
128
128
|
tabs.content_window.addstr(session.test_results.to_s)
|
129
129
|
tabs.content_window.noutrefresh
|
@@ -135,8 +135,8 @@ class Blade::Runner::Tab < Blade::Model
|
|
135
135
|
self.active = false
|
136
136
|
draw
|
137
137
|
|
138
|
-
tabs.
|
139
|
-
tabs.
|
138
|
+
tabs.state_window.clear
|
139
|
+
tabs.state_window.noutrefresh
|
140
140
|
|
141
141
|
tabs.content_window.clear
|
142
142
|
tabs.content_window.noutrefresh
|
@@ -163,7 +163,7 @@ class Blade::Runner::Tab < Blade::Model
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def color
|
166
|
-
case
|
166
|
+
case state
|
167
167
|
when "running" then colors.yellow
|
168
168
|
when "finished" then colors.green
|
169
169
|
when /fail/ then colors.red
|
data/lib/blade/server.rb
CHANGED
@@ -9,7 +9,8 @@ module Blade::Server
|
|
9
9
|
|
10
10
|
def start
|
11
11
|
Faye::WebSocket.load_adapter("thin")
|
12
|
-
|
12
|
+
Thin::Logging.silent = true
|
13
|
+
Thin::Server.start("localhost", Blade.config.port, app, signals: false)
|
13
14
|
end
|
14
15
|
|
15
16
|
def websocket_url(path = "")
|
data/lib/blade/test_results.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Blade::TestResults
|
2
|
-
attr_reader :session_id, :
|
2
|
+
attr_reader :session_id, :state, :lines, :passes, :failures, :total
|
3
3
|
|
4
4
|
def initialize(session_id)
|
5
5
|
@session_id = session_id
|
@@ -16,7 +16,7 @@ class Blade::TestResults
|
|
16
16
|
@lines = []
|
17
17
|
@passes = []
|
18
18
|
@failures = []
|
19
|
-
@
|
19
|
+
@state = "pending"
|
20
20
|
@total = 0
|
21
21
|
end
|
22
22
|
|
@@ -26,30 +26,29 @@ class Blade::TestResults
|
|
26
26
|
case details["event"]
|
27
27
|
when "begin"
|
28
28
|
reset
|
29
|
-
@
|
29
|
+
@state = "running"
|
30
30
|
@total = details["total"]
|
31
31
|
@lines << publication[:line] = "1..#{@total}"
|
32
32
|
when "result"
|
33
|
-
pass = details["result"]
|
34
33
|
args = details.values_at("name", "message")
|
35
34
|
|
36
|
-
if pass
|
35
|
+
if details["status"] == "pass"
|
37
36
|
line = Pass.new(*args).to_s
|
38
37
|
@passes << line
|
39
38
|
else
|
40
39
|
line = Failure.new(*args).to_s
|
41
40
|
@failures << line
|
42
|
-
@
|
41
|
+
@state = "failing"
|
43
42
|
end
|
44
43
|
@lines << line
|
45
44
|
|
46
|
-
publication.merge!(line: line,
|
45
|
+
publication.merge!(line: line, status: details["status"])
|
47
46
|
when "end"
|
48
|
-
@
|
47
|
+
@state = failures.any? ? "failed" : "finished"
|
49
48
|
publication[:completed] = true
|
50
49
|
end
|
51
50
|
|
52
|
-
publication.merge!(
|
51
|
+
publication.merge!(state: state, session_id: session_id)
|
53
52
|
Blade.publish("/results", publication)
|
54
53
|
end
|
55
54
|
|
data/lib/blade/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javan Makhmali
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -246,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
246
246
|
version: '0'
|
247
247
|
requirements: []
|
248
248
|
rubyforge_project:
|
249
|
-
rubygems_version: 2.4.
|
249
|
+
rubygems_version: 2.4.5
|
250
250
|
signing_key:
|
251
251
|
specification_version: 4
|
252
252
|
summary: Blade
|