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:
@@ -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": {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user