Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV-47397 - Fix failing tests on TestTemplateDefaultData #84

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions pkg/services/ngalert/notifier/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"testing"
"time" // LOGZ.IO GRAFANA CHANGE :: DEV-47397 - Append timeframe for panel/dashboard URL

"github.com/go-openapi/strfmt"
alertingModels "github.com/grafana/alerting/models"
Expand Down Expand Up @@ -125,8 +126,11 @@ CommonAnnotations: {{ range .CommonAnnotations.SortedPairs }}{{ .Name }}={{ .Val
Results: []alertingNotify.TestTemplatesResult{{
Name: "slack.title",
// LOGZ.IO GRAFANA CHANGE :: DEV-45707: remove org id query param from notification urls
Text: fmt.Sprintf("http://localhost:9093/d/%s",
DefaultAnnotations[alertingModels.DashboardUIDAnnotation]),
// LOGZ.IO GRAFANA CHANGE :: DEV-47397 - Append timeframe for panel/dashboard URL
Text: fmt.Sprintf("http://localhost:9093/d/%s?from=%d&to=%d",
DefaultAnnotations[alertingModels.DashboardUIDAnnotation],
time.Time(simpleAlert.StartsAt).Add(-5*time.Minute).UnixMilli(),
time.Time(simpleAlert.EndsAt).UnixMilli()),
// LOGZ.IO GRAFANA CHANGE :: End
}},
Errors: nil,
Expand All @@ -142,9 +146,12 @@ CommonAnnotations: {{ range .CommonAnnotations.SortedPairs }}{{ .Name }}={{ .Val
Results: []alertingNotify.TestTemplatesResult{{
Name: "slack.title",
// LOGZ.IO GRAFANA CHANGE :: DEV-45707: remove org id query param from notification urls
Text: fmt.Sprintf("http://localhost:9093/d/%s?viewPanel=%s",
// LOGZ.IO GRAFANA CHANGE :: DEV-47397 - Append timeframe for panel/dashboard URL
Text: fmt.Sprintf("http://localhost:9093/d/%s?viewPanel=%s&from=%d&to=%d",
DefaultAnnotations[alertingModels.DashboardUIDAnnotation],
DefaultAnnotations[alertingModels.PanelIDAnnotation]),
DefaultAnnotations[alertingModels.PanelIDAnnotation],
time.Time(simpleAlert.StartsAt).Add(-5*time.Minute).UnixMilli(),
time.Time(simpleAlert.EndsAt).UnixMilli()),
// LOGZ.IO GRAFANA CHANGE :: End
}},
Errors: nil,
Expand Down
Loading