Chore: Fix various spelling errors in back-end code (#25241)

* Chore: Fix various spelling errors in back-end code
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>>
This commit is contained in:
Arve Knudsen
2020-06-01 17:11:25 +02:00
committed by GitHub
parent 13787294c6
commit 07582a8e85
60 changed files with 174 additions and 168 deletions

View File

@@ -9,9 +9,10 @@ import (
func TestAlertingModelTest(t *testing.T) {
Convey("Testing Alerting model", t, func() {
json1, _ := simplejson.NewJson([]byte(`{ "field": "value" }`))
json2, _ := simplejson.NewJson([]byte(`{ "field": "value" }`))
json1, err := simplejson.NewJson([]byte(`{ "field": "value" }`))
So(err, ShouldBeNil)
json2, err := simplejson.NewJson([]byte(`{ "field": "value" }`))
So(err, ShouldBeNil)
rule1 := &Alert{
Settings: json1,
@@ -26,18 +27,18 @@ func TestAlertingModelTest(t *testing.T) {
}
Convey("Testing AlertRule equals", func() {
So(rule1.ContainsUpdates(rule2), ShouldBeFalse)
})
Convey("Changing the expression should contain update", func() {
json2, _ := simplejson.NewJson([]byte(`{ "field": "newValue" }`))
json2, err := simplejson.NewJson([]byte(`{ "field": "newValue" }`))
So(err, ShouldBeNil)
rule1.Settings = json2
So(rule1.ContainsUpdates(rule2), ShouldBeTrue)
})
Convey("Should parse alertRule tags correctly", func() {
json2, _ := simplejson.NewJson([]byte(`{
json2, err := simplejson.NewJson([]byte(`{
"field": "value",
"alertRuleTags": {
"foo": "bar",
@@ -45,6 +46,7 @@ func TestAlertingModelTest(t *testing.T) {
"tagMap": { "mapValue": "value" }
}
}`))
So(err, ShouldBeNil)
rule1.Settings = json2
expectedTags := []*Tag{
{Id: 0, Key: "foo", Value: "bar"},