Alerting: Fix Test Receivers when settings are non-strings (#62156)

* Alerting: Fix Test Receivers when settings are non-strings

As part of the Alerting extraction, we want to make sure we don't have circular depedencies. As such, I had to move `PostableGrafanaReceiver` to a new struct in `grafana/alerting` called `GrafanaReceiver`.

`PostableGrafanaReceiver` has an attribute called `Settings` that uses a Grafana-propietary struct called `RawMessage`, this struct shadows `json.RawMessage`.

When I created `GrafanaReceiver`, I turned settings into a `map[string]string` thinking all settings would end up as strings. This was a mistake, and this test proves that it doesn't work, and breaks the API.
This commit is contained in:
gotjosh
2023-01-26 12:54:03 +00:00
committed by GitHub
parent e8dd01df35
commit 0bfe150928
4 changed files with 6 additions and 5 deletions
@@ -98,7 +98,8 @@ func TestIntegrationTestReceivers(t *testing.T) {
"type": "email",
"disableResolveMessage": false,
"settings": {
"addresses":"example@email.com"
"addresses":"example@email.com",
"singleEmail": true
},
"secureFields": {}
}