Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[#5]Add docs on how to use/create notifiers

  • Loading branch information...
commit 5cd4b70191437e307d082284c8077aa91ab4d138 1 parent 6058d22
authored January 04, 2012

Showing 1 changed file with 29 additions and 0 deletions. Show diff stats Hide diff stats

  1. 29  README.markdown
29  README.markdown
Source Rendered
@@ -19,6 +19,13 @@ Get it running locally first, here's an example:
19 19
     worker.test_config = @test_config
20 20
     worker.run_local
21 21
 
  22
+Add notifier
  23
+
  24
+    worker.add_notifier("HipchatNotifier",{"hipchat_api_key"=>'secret_api_key',"room_name"=>'Room Name',"title"=>"From"})
  25
+and/or
  26
+    worker.add_notifier("WebHookNotifier",{"url"=>'notification_url'})
  27
+you could add as many notifiers as you need
  28
+
22 29
 Then try queuing it up.
23 30
 
24 31
     worker.queue
@@ -31,3 +38,25 @@ Schedule it to run regularly to ensure you're always being covered.
31 38
 
32 39
     worker.schedule(:start_at=>Time.now, :run_every=>3600)
33 40
 
  41
+## Custom notifiers
  42
+All you need:
  43
+
  44
+* Implement in your notificator following methods:
  45
+    def initialize(notifier_details)
  46
+      #here you'll need to setup configuration ie:
  47
+      @url = notifier_details["url"]
  48
+    end
  49
+
  50
+    def send_message(message)
  51
+      # here you need to process simple text message
  52
+      post(message)
  53
+    end
  54
+
  55
+    #if you need you could process more detailed results
  56
+
  57
+    def send_formatted_message(result)
  58
+      # result is an instance of Test::Unit::TestResult
  59
+    end
  60
+* Add your custom notifier into 'notifiers' folder or just merge it
  61
+* Add your notifier to worker
  62
+     worker.add_notifier("YourCustomNotifierClass",{"option_name"=>'option_value'})

0 notes on commit 5cd4b70

Please sign in to comment.
Something went wrong with that request. Please try again.