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

Remove AM integration test function with slack hook url #1258

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions tests/pkg/tests/observability_alert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ var _ = Describe("Observability:", func() {
}, EventuallyTimeoutMinute*5, EventuallyIntervalSecond*5).Should(Succeed())
})

// TODO(subbarao): Re-enable slack integration test once issue mentioned in
// https://github.com/stolostron/multicluster-observability-operator/pull/1112 &
// https://github.com/stolostron/multicluster-observability-operator/pull/1258
// is addressed.
// It("[P2][Sev2][observability][Stable] Should modify the SECRET: alertmanager-config (alert/g0)", func() {
// By("Editing the secret, we should be able to add the third partying tools integrations")
// secret := utils.CreateCustomAlertConfigYaml(testOptions.HubCluster.BaseDomain)
Expand Down
49 changes: 0 additions & 49 deletions tests/pkg/utils/mco_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package utils

import (
"context"
b64 "encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
Expand Down Expand Up @@ -869,51 +868,3 @@ func UninstallMCO(opt TestOptions) error {

return nil
}

func CreateCustomAlertConfigYaml(baseDomain string) []byte {
global := fmt.Sprintf(`global:
resolve_timeout: 5m
route:
receiver: default-receiver
routes:
- match:
alertname: Watchdog
receiver: default-receiver
group_by: ['alertname', 'cluster']
group_wait: 5s
group_interval: 5s
repeat_interval: 2m
receivers:
- name: default-receiver
slack_configs:
- api_url: https://hooks.slack.com/services/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
channel: team-observability-test
footer: |
{{ .CommonLabels.cluster }}
mrkdwn_in:
- text
title: '[{{ .Status | toUpper }}] {{ .CommonLabels.alertname }} ({{ .CommonLabels.severity }})'
text: |-
{{ range .Alerts }}
*Alerts:* {{ .Annotations.summary }}
*Description:* {{ .Annotations.description }}
*Details:*
{{ range .Labels.SortedPairs }} • *{{ .Name }}:* {{ .Value }}
{{ end }}
{{ end }}
title_link: https://multicloud-console.apps.%s/grafana/explore?orgId=1&left=["now-1h","now","Observatorium",{"expr":"ALERTS{alertname=\"{{ .CommonLabels.alertname }}\"}","context":"explore"},{"mode":"Metrics"},{"ui":[true,true,true,"none"]}]
`, baseDomain)
encodedGlobal := b64.StdEncoding.EncodeToString([]byte(global))

instance := fmt.Sprintf(`kind: Secret
apiVersion: v1
metadata:
name: alertmanager-config
namespace: open-cluster-management-observability
data:
alertmanager.yaml: >-
%s
`, encodedGlobal)

return []byte(instance)
}