Skip to content

Commit

Permalink
Remove AM integration test function with slack hook url (#1258)
Browse files Browse the repository at this point in the history
Signed-off-by: Saswata Mukherjee <[email protected]>
  • Loading branch information
saswatamcode authored Oct 17, 2023
1 parent 0108aa8 commit 27eea75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 49 deletions.
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)
}

0 comments on commit 27eea75

Please sign in to comment.