Message:"Some kind of message that is too long for appending to our pretty little message, this line is actually exactly 197 chars long and I will get there in the end I promise I will. Yes siree that's it.",
State:m.AlertStateOK,
})
caption:=generateImageCaption(evalContext,
"http://grafa.url/foo",
"")
So(len(caption),ShouldBeLessThanOrEqualTo,200)
So(caption,ShouldContainSubstring,"[OK] This is an alarm")
So(caption,ShouldNotContainSubstring,"http")
So(caption,ShouldContainSubstring,"Some kind of message that is too long for appending to our pretty little message, this line is actually exactly 197 chars long and I will get there in the end I promise ")
})
Convey("Metrics should be skipped if they dont fit",func(){
Message:"Some kind of message that is too long for appending to our pretty little message, this line is actually exactly 197 chars long and I will get there in the end I ",
State:m.AlertStateOK,
})
caption:=generateImageCaption(evalContext,
"http://grafa.url/foo",
"foo bar long song")
So(len(caption),ShouldBeLessThanOrEqualTo,200)
So(caption,ShouldContainSubstring,"[OK] This is an alarm")