bumbleworks-gui 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: cc4490ff3c596a984d4b6940f742de3d6476460b
4
- data.tar.gz: 11b127ebf00a42af42ad8b00d07f18916131a4ea
3
+ metadata.gz: 8899a29374d7292f4913d0497a443c5b07887f80
4
+ data.tar.gz: 96be83f74b4edb10a5c3a5f23eef9b4821fafac0
5
5
  SHA512:
6
- metadata.gz: 4ba3bd612b5aefdfce7a8cbc6d7f3fc4063030821baf63a11087e60d145b50f7e94fe93d14b91d7580a2f89717e9564af783bebc7a45498de24f57986d202635
7
- data.tar.gz: 8f4b1732ae4f1406ace7778eac4198027890a58dc9cfee01319e4fff39d9b89339ffbaa0f00d3333ec1ed6cf0a3d878f2109837d41c22852d53cfcdea4be420f
6
+ metadata.gz: ebf9b88d3264d43f2575da665f977d08e21bdac9ac52ce0b0600bc9a44136dfae3354ec467cdf5fac46ef0f9e2f0b788c187222eb9b4f000e71072341e928da2
7
+ data.tar.gz: edd2af1199839d98de6b7358c396a80f0bb38640a01da96831d35d69d467a2f311853b8ae52248fe178f7a7986985c01ac78be6f178c6353a4f517526218052f
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_runtime_dependency "bumbleworks", ">= 0.0.83"
22
+ spec.add_runtime_dependency "bumbleworks", ">= 0.0.87"
23
23
  spec.add_runtime_dependency "rory", ">= 0.3.11"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.3"
data/config.ru CHANGED
@@ -22,8 +22,10 @@ wp = Bumbleworks.launch!('waiting_process')
22
22
 
23
23
  wait_until(:timeout => 30) { wp.reload.trackers.count == 4 }
24
24
 
25
- widget_processes.first.tasks.each do |t|
26
- t.complete
25
+ widget_processes.first(3).each do |p|
26
+ p.tasks.each do |t|
27
+ t.complete
28
+ end
27
29
  end
28
30
 
29
31
  if ENV['MOUNT_AT']
@@ -61,13 +61,16 @@ dd {
61
61
  .button-secondary { background: rgb(66, 184, 221); } /* lt. blue */
62
62
 
63
63
  .action-button-group {
64
- width: 7.5em;
64
+ width: 100%;
65
65
  }
66
66
 
67
+ .inline {
68
+ display: inline;
69
+ }
67
70
  /* pagination */
68
71
 
69
72
  .pagination li.active a {
70
73
  color: #000;
71
74
  pointer-events: none;
72
75
  cursor: default;
73
- }
76
+ }
@@ -43,7 +43,6 @@ a:focus {
43
43
  .content {
44
44
  margin: 0 auto;
45
45
  padding: 0 2em;
46
- max-width: 800px;
47
46
  margin-bottom: 50px;
48
47
  line-height: 1.6em;
49
48
  }
@@ -12,6 +12,9 @@ Bumbleworks::Gui::Application.set_routes do
12
12
  match '/processes/:pid/expressions/:id', :to => 'expressions#show', :methods => [:get]
13
13
  match '/processes/:pid/expressions/:id/cancel', :to => 'expressions#cancel', :methods => [:delete]
14
14
  match '/processes/:pid/expressions/:id/kill', :to => 'expressions#kill', :methods => [:delete]
15
+ match '/errors', :to => 'errors#index', :methods => [:get]
16
+ match '/processes/:pid/expressions/:id/error', :to => 'errors#show', :methods => [:get]
17
+ match '/processes/:pid/expressions/:id/error/replay', :to => 'errors#replay', :methods => [:put]
15
18
  match '/processes/:id', :to => 'processes#show', :methods => [:get]
16
19
  match '/processes/page/:page', :to => 'processes#index', :methods => [:get]
17
20
  match '/processes', :to => 'processes#index', :methods => [:get]
@@ -0,0 +1,32 @@
1
+ module Bumbleworks
2
+ module Gui
3
+ class ErrorsController < ApplicationController
4
+ def index
5
+ expose :errors => Bumbleworks.errors
6
+ end
7
+
8
+ def show
9
+ expose :expression => expression, :process => process, :error => error
10
+ end
11
+
12
+ def replay
13
+ error.replay
14
+ redirect path_to('expressions_show', :pid => process.id, :id => expression.expid)
15
+ end
16
+
17
+ private
18
+
19
+ def expression
20
+ process.expression_at_position(params[:id])
21
+ end
22
+
23
+ def error
24
+ expression.error
25
+ end
26
+
27
+ def process
28
+ Bumbleworks::Process.new(params[:pid])
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
1
  module Bumbleworks
2
2
  module Gui
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
@@ -1,4 +1,11 @@
1
1
  <dl>
2
+ <% unless Bumbleworks.errors.empty? %>
3
+ <dt>Errors</dt>
4
+ <dd>
5
+ <%= render 'shared/errors', :locals => { :errors => Bumbleworks.errors } %>
6
+ </dd>
7
+ <% end %>
8
+
2
9
  <dt>Entities</dt>
3
10
  <dd>
4
11
  <%= render 'shared/entity_types', :locals => { :entity_classes => entity_classes} %>
@@ -0,0 +1,8 @@
1
+ <div class="action-button-group">
2
+ <form action="<%= path_to 'errors_replay', :pid => error.process.id, :id => error.expression.expid %>" class="inline" method="post">
3
+ <input type="hidden" name="_method" value="put">
4
+ <button type="submit" class="pure-button button-warning button-top" id="replay-button">
5
+ Replay
6
+ </button>
7
+ </form>
8
+ </div>
@@ -0,0 +1,3 @@
1
+ <div>
2
+ <%= render 'shared/errors', :locals => { :errors => errors, :context => :global } %>
3
+ </div>
@@ -0,0 +1,24 @@
1
+ <dl>
2
+ <dt>Process</dt>
3
+ <dd><a href="<%= path_to 'processes_show', :id => process.id %>"><%= process.id %></a></dd>
4
+
5
+ <dt>Expression ID</dt>
6
+ <dd><%= expression.expid %></dd>
7
+
8
+ <dt>Error Type</dt>
9
+ <dd><%= error.error_class_name %></dd>
10
+
11
+ <dt>Message</dt>
12
+ <dd><%= error.message %></dd>
13
+
14
+ <dt>Backtrace</dt>
15
+ <dd>
16
+ <pre class="prettyprint linenums" style="overflow-x: scroll; white-space: nowrap"><code class="language-ruby"><% error.backtrace.each do |btl| %><%= "#{btl.inspect}\n" %><% end %></code></pre>
17
+ </dd>
18
+
19
+ <dt>Actions</dt>
20
+ <dd>
21
+ <%= render 'errors/actions', :locals => { :error => error } %>
22
+ </dd>
23
+ </dl>
24
+
@@ -9,24 +9,9 @@
9
9
  <dd>
10
10
  <%= render 'expressions/actions', :locals => { :expression => expression } %>
11
11
  </dd>
12
- <% if expression.error %>
13
- <h3>Error</h3>
14
- <dl>
15
- <dd>
16
- <dt>Type</dt>
17
- <dd><%= expression.error.error_class_name %></dd>
18
-
19
- <dt>Message</dt>
20
- <dd><%= expression.error.message %></dd>
21
12
 
22
- <dt>Backtrace</dt>
23
- <dd>
24
- <ul>
25
- <% expression.error.backtrace.each do |btl| %>
26
- <li><%= btl %></li>
27
- <% end %>
28
- </ul>
29
- </dd>
30
- </dd>
31
- </dl>
32
- <% end %>
13
+ <% if expression.error %>
14
+ <dt>Error</dt>
15
+ <dd><%= render 'shared/errors', :locals => { :errors => [expression.error], :context => :expression } %></dd>
16
+ <% end %>
17
+ </dl>
@@ -13,6 +13,7 @@
13
13
  <script src="<%= base_path %>/assets/js/jquery.js"></script>
14
14
  <script src="<%= base_path %>/assets/js/list.min.js"></script>
15
15
  <script src="<%= base_path %>/assets/js/list.pagination.min.js"></script>
16
+ <script src="//google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sons-of-obsidian"></script>
16
17
 
17
18
  </head>
18
19
  <body>
@@ -32,6 +33,7 @@
32
33
  <li><a href="<%= path_to 'trackers_index' %>">Trackers</a></li>
33
34
  <li><a href="<%= path_to 'tasks_index' %>">Tasks</a></li>
34
35
  <li><a href="<%= path_to 'workers_index' %>">Workers</a></li>
36
+ <li><a href="<%= path_to 'errors_index' %>">Errors</a></li>
35
37
  </ul>
36
38
  </div>
37
39
  </div>
@@ -27,6 +27,13 @@
27
27
  <%= render 'shared/expressions', :locals => { :expressions => process.leaves } %>
28
28
  </dd>
29
29
 
30
+ <% unless process.errors.empty? %>
31
+ <dt>Errors</dt>
32
+ <dd>
33
+ <%= render 'shared/errors', :locals => { :errors => process.errors, :context => :process } %>
34
+ </dd>
35
+ <% end %>
36
+
30
37
  <script>
31
38
  var Fluos = {
32
39
  'fluo': {
@@ -0,0 +1,38 @@
1
+ <% view_context = (defined?(context) && context) || :global %>
2
+ <div id="errors">
3
+ <table class="pure-table pure-table-bordered">
4
+ <thead>
5
+ <tr>
6
+ <% if view_context == :global %>
7
+ <th class="sort" data-sort="process">Process</th>
8
+ <% end %>
9
+ <% if [:global, :process].include?(view_context) %>
10
+ <th class="sort" data-sort="expression">Expression</th>
11
+ <% end %>
12
+ <th class="sort" data-sort="type">Error Class</th>
13
+ <th class="sort" data-sort="message">Message</th>
14
+ <th></th>
15
+ </tr>
16
+ </thead>
17
+ <tbody class="list">
18
+ <% errors.each do |err| %>
19
+ <tr>
20
+ <% if view_context == :global %>
21
+ <td class="process"><a href="<%= path_to 'processes_show', :id => err.process.id %>"><%= err.wfid %></a></td>
22
+ <% end %>
23
+ <% if [:global, :process].include?(view_context) %>
24
+ <td class="expression"><a href="<%= path_to 'expressions_show', :pid => err.process.id, :id => err.expression.expid %>"><%= err.expression.expid %></a></td>
25
+ <% end %>
26
+ <td class="type"><a href="<%= path_to 'errors_show', :pid => err.process.id, :id => err.expression.expid %>"><%= err.error_class_name %></a></td>
27
+ <td class="message"><%= err.message %></td>
28
+ <td><%= render 'errors/actions', :locals => { :error => err } %></td>
29
+ </tr>
30
+ <% end %>
31
+ </tbody>
32
+ </table>
33
+ </div>
34
+
35
+ <%= render 'shared/list_js_script', :locals => {
36
+ :list_id => 'expressions',
37
+ :rows => errors.count
38
+ } %>
@@ -13,7 +13,7 @@
13
13
  <tr>
14
14
  <td class="id"><a href="<%= path_to 'expressions_show', :pid => exp.process.id, :id => exp.expid %>"><%= exp.expid %></a></td>
15
15
  <td class="tree"><%= exp.tree %></td>
16
- <td class="error"><%= exp.error.message if exp.error %></td>
16
+ <td class="error"><a href="<%= path_to 'errors_show', :pid => exp.process.id, :id => exp.expid %>"><%= exp.error.message if exp.error %></a></td>
17
17
  <td><%= render 'expressions/actions', :locals => { :expression => exp } %></td>
18
18
  </tr>
19
19
  <% end %>
@@ -0,0 +1,49 @@
1
+ feature "Error administration" do
2
+ let(:error_index) { ErrorIndex.new(Capybara) }
3
+ let(:expression_detail) { ExpressionDetail.new(Capybara) }
4
+ let(:error_detail) { ErrorDetail.new(Capybara) }
5
+ let(:process) {
6
+ process = Bumbleworks.launch!('task_process')
7
+ wait_until { process.reload.tasks.count == 2 }
8
+ process
9
+ }
10
+ let(:error_expression) {
11
+ process.tasks.each { |t| t.complete }
12
+ wait_until(:timeout => 10) { process.reload.leaves.first.error }
13
+ process.leaves.first
14
+ }
15
+
16
+ after(:each) do
17
+ NaughtyParticipant.naughty_is_ok = false
18
+ end
19
+
20
+ scenario "Admin views error index" do
21
+ process2 = Bumbleworks.launch!('task_process')
22
+ wait_until { process2.reload.tasks.count == 2 }
23
+ process2.tasks.each { |t| t.complete }
24
+ error_expression
25
+
26
+ visit_scoped "/errors"
27
+
28
+ expect(error_index).to have_errors([error_expression.error, process2.errors.first])
29
+ end
30
+
31
+ scenario "Admin views error detail" do
32
+ expression = error_expression
33
+
34
+ visit_scoped "/processes/#{process.id}/expressions/#{expression.expid}/error"
35
+
36
+ expect(error_detail).to have_error(expression.error)
37
+ end
38
+
39
+ scenario "Admin replays error" do
40
+ expression = error_expression
41
+ NaughtyParticipant.naughty_is_ok = true
42
+ visit_scoped "/processes/#{process.id}/expressions/#{expression.expid}/error"
43
+ click_button 'Replay'
44
+
45
+ wait_until { process.reload.tasks.count == 1 }
46
+ visit_scoped "/processes/#{process.id}"
47
+ expect(expression_detail).not_to have_error(expression.error)
48
+ end
49
+ end
@@ -37,12 +37,12 @@ feature "Expression administration" do
37
37
 
38
38
  wait_until { process.reload.errors.empty? }
39
39
  visit_scoped "/processes/#{process.id}"
40
- expect(process_detail).not_to have_error(NaughtyParticipant::StupidError.new("Oh crumb."))
40
+ expect(process_detail).not_to have_error(error_expression.error)
41
41
  end
42
42
 
43
43
  scenario "Admin views expression errors" do
44
44
  visit_scoped "/processes/#{process.id}/expressions/#{error_expression.expid}"
45
45
 
46
- expect(expression_detail).to have_error(NaughtyParticipant::StupidError.new("Oh crumb."))
46
+ expect(expression_detail).to have_error(error_expression.error)
47
47
  end
48
48
  end
@@ -2,7 +2,15 @@ class NaughtyParticipant
2
2
  class StupidError < StandardError; end
3
3
  include Bumbleworks::LocalParticipant
4
4
 
5
+ class << self
6
+ attr_accessor :naughty_is_ok
7
+ end
8
+
5
9
  def on_workitem
6
- raise StupidError, 'Oh crumb.'
10
+ if self.class.naughty_is_ok
11
+ reply
12
+ else
13
+ raise StupidError, 'Oh crumb.'
14
+ end
7
15
  end
8
16
  end
@@ -33,6 +33,10 @@ RSpec.configure do |config|
33
33
  Bumbleworks.start_worker!
34
34
  end
35
35
 
36
+ config.before(:each) do
37
+ Bumbleworks.kill_all_processes!
38
+ end
39
+
36
40
  config.after(:suite, :type => :features) do
37
41
  Bumbleworks::Worker.shutdown_all
38
42
  end
@@ -0,0 +1,6 @@
1
+ class ErrorDetail < WindowDriver
2
+ def has_error?(error)
3
+ page.has_text?(error.error_class_name) &&
4
+ page.has_text?(error.message)
5
+ end
6
+ end
@@ -0,0 +1,12 @@
1
+ class ErrorIndex < WindowDriver
2
+ def has_error?(error)
3
+ page.has_text?(error.error_class_name) &&
4
+ page.has_text?(error.message)
5
+ end
6
+
7
+ def has_errors?(errors)
8
+ errors.all? do |error|
9
+ has_error?(error)
10
+ end
11
+ end
12
+ end
@@ -5,7 +5,7 @@ class ExpressionDetail < WindowDriver
5
5
  end
6
6
 
7
7
  def has_error?(error)
8
- page.has_text?(error.class.name) &&
8
+ page.has_text?(error.error_class_name) &&
9
9
  page.has_text?(error.message)
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bumbleworks-gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ravi Gadad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-11 00:00:00.000000000 Z
11
+ date: 2014-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bumbleworks
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.83
19
+ version: 0.0.87
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.83
26
+ version: 0.0.87
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rory
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -154,6 +154,7 @@ files:
154
154
  - lib/bumbleworks/gui/controllers/application_controller.rb
155
155
  - lib/bumbleworks/gui/controllers/dashboards_controller.rb
156
156
  - lib/bumbleworks/gui/controllers/entities_controller.rb
157
+ - lib/bumbleworks/gui/controllers/errors_controller.rb
157
158
  - lib/bumbleworks/gui/controllers/expressions_controller.rb
158
159
  - lib/bumbleworks/gui/controllers/processes_controller.rb
159
160
  - lib/bumbleworks/gui/controllers/tasks_controller.rb
@@ -165,12 +166,16 @@ files:
165
166
  - lib/bumbleworks/gui/views/entities/index.html.erb
166
167
  - lib/bumbleworks/gui/views/entities/show.html.erb
167
168
  - lib/bumbleworks/gui/views/entities/types.html.erb
169
+ - lib/bumbleworks/gui/views/errors/actions.html.erb
170
+ - lib/bumbleworks/gui/views/errors/index.html.erb
171
+ - lib/bumbleworks/gui/views/errors/show.html.erb
168
172
  - lib/bumbleworks/gui/views/expressions/actions.html.erb
169
173
  - lib/bumbleworks/gui/views/expressions/show.html.erb
170
174
  - lib/bumbleworks/gui/views/layouts/default.html.erb
171
175
  - lib/bumbleworks/gui/views/processes/index.html.erb
172
176
  - lib/bumbleworks/gui/views/processes/show.html.erb
173
177
  - lib/bumbleworks/gui/views/shared/entity_types.html.erb
178
+ - lib/bumbleworks/gui/views/shared/errors.html.erb
174
179
  - lib/bumbleworks/gui/views/shared/expressions.html.erb
175
180
  - lib/bumbleworks/gui/views/shared/list_js_script.html.erb
176
181
  - lib/bumbleworks/gui/views/shared/pagination.html.erb
@@ -187,6 +192,7 @@ files:
187
192
  - lib/bumbleworks/gui/views/workers/show.html.erb
188
193
  - spec/features/dashboard_display_spec.rb
189
194
  - spec/features/entity_administration_spec.rb
195
+ - spec/features/error_administration_spec.rb
190
196
  - spec/features/expression_administration_spec.rb
191
197
  - spec/features/process_administration_spec.rb
192
198
  - spec/features/task_administration_spec.rb
@@ -206,6 +212,8 @@ files:
206
212
  - spec/support/drivers/entity_detail.rb
207
213
  - spec/support/drivers/entity_index.rb
208
214
  - spec/support/drivers/entity_type_index.rb
215
+ - spec/support/drivers/error_detail.rb
216
+ - spec/support/drivers/error_index.rb
209
217
  - spec/support/drivers/expression_detail.rb
210
218
  - spec/support/drivers/process_detail.rb
211
219
  - spec/support/drivers/process_index.rb
@@ -246,6 +254,7 @@ summary: This gem enables a Rory application (mountable in your own app) to make
246
254
  test_files:
247
255
  - spec/features/dashboard_display_spec.rb
248
256
  - spec/features/entity_administration_spec.rb
257
+ - spec/features/error_administration_spec.rb
249
258
  - spec/features/expression_administration_spec.rb
250
259
  - spec/features/process_administration_spec.rb
251
260
  - spec/features/task_administration_spec.rb
@@ -265,6 +274,8 @@ test_files:
265
274
  - spec/support/drivers/entity_detail.rb
266
275
  - spec/support/drivers/entity_index.rb
267
276
  - spec/support/drivers/entity_type_index.rb
277
+ - spec/support/drivers/error_detail.rb
278
+ - spec/support/drivers/error_index.rb
268
279
  - spec/support/drivers/expression_detail.rb
269
280
  - spec/support/drivers/process_detail.rb
270
281
  - spec/support/drivers/process_index.rb