(ns riemann.slack-test
  (:use riemann.slack
        clojure.test)
  (:require [riemann.logging :as logging]))


(def api-key (System/getenv "SLACK_API_KEY"))
(def room (System/getenv "SLACK_ALERT_ROOM"))
(def account (System/getenv "SLACK_ALERT_ACCOUNT"))
(def user "Riemann_Slack_Test")

(when-not api-key
  (println "export SLACK_API_KEY=\"...\" to run these tests."))

(when-not room
  (println "export SLACK_ALERT_ROOM=\"...\" to run these tests."))

(when-not account
  (println "export SLACK_ALERT_ACCOUNT=\"...\" to run these tests."))

(logging/init)

(deftest ^:slack test_event
  (let [slack_connect (slack account api-key user room)]
    (slack_connect {:host "localhost"
         :service "good event test"
         :description "Testing slack.com alerts from riemann"
         :metric 42
         :state "ok"})))

(ns riemann.slack-test
  (:use riemann.slack
        clojure.test)
  (:require [riemann.logging :as logging]))


(def api-key (System/getenv "SLACK_API_KEY"))
(def room (System/getenv "SLACK_ALERT_ROOM"))
(def account (System/getenv "SLACK_ALERT_ACCOUNT"))
(def user "Riemann_Slack_Test")

(when-not api-key
  (println "export SLACK_API_KEY=\"...\" to run these tests."))

(when-not room
  (println "export SLACK_ALERT_ROOM=\"...\" to run these tests."))

(when-not account
  (println "export SLACK_ALERT_ACCOUNT=\"...\" to run these tests."))

(logging/init)

(deftest ^:slack ^:integration test_event
  (let [slack_connect (slack account api-key user room)]
    (slack_connect {:host "localhost"
                    :service "good event test"
                    :description "Testing slack.com alerts from riemann"
                    :metric 42
                    :state "ok"})))

Mark slack tests as integration
Mark slack tests as integration

DasAllFolks/riemann,riemann/riemann,abailly/riemann,robashton/riemann,mirwan/riemann,eric/riemann,rhysr/riemann,bowlofstew/riemann,VideoAmp/riemann-1,fullcontact/riemann,lispmeister/riemann,zamaterian/riemann,moonranger/riemann,mbuczko/riemann,timbuchwaldt/riemann,alq666/riemann,patrox/riemann,mbuczko/riemann,yeller/riemann,mirwan/riemann,timbuchwaldt/riemann,forter/riemann,pradeepchhetri/riemann,shokunin/riemann,bfritz/riemann,joerayme/riemann,Anvil/riemann,nberger/riemann,rhysr/riemann,pyr/riemann,jeanpralo/riemann,vixns/riemann,counsyl/riemann,forter/riemann,joerayme/riemann,lispmeister/riemann,irudyak/riemann,aphyr/riemann,bmhatfield/riemann,alq666/riemann,DasAllFolks/riemann,topecz/riemann,bg451/riemann,robashton/riemann,LubyRuffy/riemann,counsyl/riemann,patrox/riemann,AkihiroSuda/riemann,irudyak/riemann,bowlofstew/riemann,aphyr/riemann,nberger/riemann,abailly/riemann,lispmeister/riemann,mirwan/riemann,LubyRuffy/riemann,bg451/riemann,moonranger/riemann,rekhajoshm/riemann,eric/riemann,cswaroop/riemann,ClodoCorp/riemann,patrox/riemann,bfritz/riemann,micrub/riemann,vincentbernat/riemann,topecz/riemann,tzach/riemann,rhysr/riemann,VideoAmp/riemann-1,bmhatfield/riemann,jeanpralo/riemann,pharaujo/riemann,shokunin/riemann,algernon/riemann,pyr/riemann,yeller/riemann,forter/riemann,bwilber/riemann,rekhajoshm/riemann,zamaterian/riemann,pharaujo/riemann,jamtur01/riemann,ClodoCorp/riemann,cswaroop/riemann,tzach/riemann,micrub/riemann,AkihiroSuda/riemann,rekhajoshm/riemann,algernon/riemann,riemann/riemann,bwilber/riemann,cswaroop/riemann,shokunin/riemann,micrub/riemann,fullcontact/riemann,tzach/riemann,Anvil/riemann,vixns/riemann,topecz/riemann,yeller/riemann,jamtur01/riemann,ClodoCorp/riemann,algernon/riemann,vincentbernat/riemann,fullcontact/riemann,pradeepchhetri/riemann