Alerting: Add api client to integration tests (#50970)

This commit is contained in:
Yuriy Tseretyan
2022-06-21 11:39:22 -04:00
committed by GitHub
parent 53714282cd
commit 53d03aec78
6 changed files with 289 additions and 392 deletions
@@ -744,6 +744,8 @@ func TestNotificationChannels(t *testing.T) {
Login: "grafana",
})
apiClient := newAlertingApiClient(grafanaListedAddr, "grafana", "password")
{
// There are no notification channel config initially - so it returns the default configuration.
alertsURL := fmt.Sprintf("http://grafana:password@%s/api/alertmanager/grafana/config/api/v1/alerts", grafanaListedAddr)
@@ -755,8 +757,7 @@ func TestNotificationChannels(t *testing.T) {
{
// Create the namespace we'll save our alerts to.
err := createFolder(t, "default", grafanaListedAddr, "grafana", "password")
require.NoError(t, err)
apiClient.CreateFolder(t, "default", "default")
reloadCachedPermissions(t, grafanaListedAddr, "grafana", "password")
// Post the alertmanager config.