Alerting: Add two missing tests which cover missing URLs for Loki state history (#70460)

Add two missing tests which cover individual missing URLs
This commit is contained in:
Alexander Weaver 2023-06-21 12:58:37 -05:00 committed by GitHub
parent d8ffc6be5e
commit ce6f73bd32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,20 @@ func TestLokiConfig(t *testing.T) {
expRead: "http://read.url.com",
expWrite: "http://url.com",
},
{
name: "missing read",
in: setting.UnifiedAlertingStateHistorySettings{
LokiWriteURL: "http://url.com",
},
expErr: "either read path URL or remote",
},
{
name: "missing write",
in: setting.UnifiedAlertingStateHistorySettings{
LokiReadURL: "http://url.com",
},
expErr: "either write path URL or remote",
},
{
name: "invalid",
in: setting.UnifiedAlertingStateHistorySettings{