sidekiq-failures 0.0.1.pre → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Sidekiq::Failures
1
+ # Sidekiq::Failures [![Build Status](https://secure.travis-ci.org/mhfs/sidekiq-failures.png)](http://travis-ci.org/mhfs/sidekiq-failures)
2
2
 
3
3
  Keeps track of Sidekiq failed jobs and adds a tab to the Web UI to let you browse
4
4
  them. Makes use of Sidekiq's custom tabs and middleware chain.
@@ -9,10 +9,6 @@ Note that each failed retry will create a new failed job. This might result in a
9
9
  pretty big failures list. Think twice before using this project. In most cases
10
10
  automatic retries allied to exception notifications will be enough.
11
11
 
12
- ## Important Note!
13
-
14
- This is an ongoing, alpha level project. Be prepared that the API might change and bugs might occur.
15
-
16
12
  ## Installation
17
13
 
18
14
  Add this line to your application's Gemfile:
@@ -31,6 +27,12 @@ Simply having the gem in your Gemfile should be enough.
31
27
 
32
28
  Your failed jobs will be visible via a Failures tab in the Web UI.
33
29
 
30
+ ## TODO and Limitations
31
+
32
+ * Skip failures of specific workers (or the opposite).
33
+ * Trigger retry of specific failed jobs via Web UI.
34
+ * Deal with retries. Maybe just track a failure when there's no attempt left.
35
+
34
36
  ## Contributing
35
37
 
36
38
  1. Fork it
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Failures
3
- VERSION = "0.0.1.pre"
3
+ VERSION = "0.0.1"
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  h1 Failed Jobs
2
2
 
3
3
  - if @messages.size > 0
4
- == slim :_paging, :locals => { :url => "#{root_path}queues/#{@name}" }
4
+ == slim :_paging, :locals => { :url => "#{root_path}failures/#@name" }
5
5
 
6
6
  table class="table table-striped table-bordered"
7
7
  tr
@@ -20,7 +20,10 @@ h1 Failed Jobs
20
20
  td= msg['error']
21
21
  td= msg['failed_at']
22
22
 
23
- == slim :_paging, :locals => { :url => "#{root_path}queues/#{@name}" }
23
+ form.form-horizontal action="#{root_path}failures/remove" method="post"
24
+ input.btn.btn-danger type="submit" name="delete" value="Clear All"
25
+
26
+ == slim :_paging, :locals => { :url => "#{root_path}failures/#@name" }
24
27
  - else
25
28
  p No failed jobs found.
26
29
  a href="#{root_path}" Back
@@ -18,6 +18,12 @@ module Sidekiq
18
18
 
19
19
  slim :failures
20
20
  end
21
+
22
+ app.post "/failures/remove" do
23
+ Sidekiq.redis {|c| c.del(:failed) }
24
+
25
+ redirect "#{root_path}/failures"
26
+ end
21
27
  end
22
28
  end
23
29
  end
@@ -28,13 +28,40 @@ module Sidekiq
28
28
  last_response.body.must_match /No failed jobs found/
29
29
  end
30
30
 
31
- it 'can display failures page with failures listed' do
32
- create_sample_failure
33
- get '/failures'
34
- last_response.status.must_equal 200
35
- last_response.body.must_match /HardWorker/
36
- last_response.body.must_match /ArgumentError/
37
- last_response.body.wont_match /No failed jobs found/
31
+ describe 'when there are failures' do
32
+ before do
33
+ create_sample_failure
34
+ get '/failures'
35
+ end
36
+
37
+ it 'should be successful' do
38
+ last_response.status.must_equal 200
39
+ end
40
+
41
+ it 'can display failures page with failures listed' do
42
+ last_response.body.must_match /Failed Jobs/
43
+ last_response.body.must_match /HardWorker/
44
+ last_response.body.must_match /ArgumentError/
45
+ last_response.body.wont_match /No failed jobs found/
46
+ end
47
+
48
+ it 'has the clear all form and action' do
49
+ last_response.body.must_match /failures\/remove/
50
+ last_response.body.must_match /method=\"post/
51
+ last_response.body.must_match /Clear All/
52
+ end
53
+
54
+ it 'can remove all failures' do
55
+ last_response.body.must_match /HardWorker/
56
+
57
+ post '/failures/remove'
58
+ last_response.status.must_equal 302
59
+ last_response.location.must_match /failures$/
60
+
61
+ get '/failures'
62
+ last_response.status.must_equal 200
63
+ last_response.body.must_match /No failed jobs found/
64
+ end
38
65
  end
39
66
 
40
67
  def create_sample_failure
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-failures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre
5
- prerelease: 6
4
+ version: 0.0.1
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marcelo Silveira
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-24 00:00:00.000000000 Z
12
+ date: 2012-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -143,13 +143,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  segments:
145
145
  - 0
146
- hash: -3924324367283502437
146
+ hash: -2307367845449667201
147
147
  required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  none: false
149
149
  requirements:
150
- - - ! '>'
150
+ - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
- version: 1.3.1
152
+ version: '0'
153
+ segments:
154
+ - 0
155
+ hash: -2307367845449667201
153
156
  requirements: []
154
157
  rubyforge_project:
155
158
  rubygems_version: 1.8.23