Skip to content

Commit f7cdf63

Browse files
committed
revert part
1 parent cabe545 commit f7cdf63

File tree

1 file changed

+56
-55
lines changed

1 file changed

+56
-55
lines changed

test/monitoring/monitoring.go

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
12021202

12031203
// This test is already covered in test/e2e/config_test.go::TestUserWorkloadMonitorPrometheusK8Config
12041204
// author: [email protected]
1205-
/* g.It("Author:hongyli-High-49745-High-50519-Retention for UWM Prometheus and thanos ruler", func() {
1205+
/* g.It("Author:hongyli-High-49745-High-50519-Retention for UWM Prometheus and thanos ruler", func() {
12061206
exutil.By("Check retention size of prometheus user workload")
12071207
checkRetention(oc, "openshift-user-workload-monitoring", "prometheus-user-workload", "storage.tsdb.retention.size=5GiB", uwmLoadTime)
12081208
exutil.By("Check retention of prometheus user workload")
@@ -1242,7 +1242,7 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
12421242

12431243
// This test is already covered in test/e2e/config_test.go::TestUserWorkloadMonitorPrometheusK8Config and test/e2e/config_test.go::TestClusterMonitorPrometheusK8Config
12441244
// author: [email protected]
1245-
/* g.It("Author:tagao-LEVEL0-Medium-46301-Allow OpenShift users to configure query log file for Prometheus", func() {
1245+
/* g.It("Author:tagao-LEVEL0-Medium-46301-Allow OpenShift users to configure query log file for Prometheus", func() {
12461246
exutil.By("confirm prometheus-k8s-0 pod is ready for check")
12471247
MONpod, _ := oc.AsAdmin().WithoutNamespace().Run("get").Args("pod", "-n", "openshift-monitoring").Output()
12481248
e2e.Logf("the MON pods condition: %s", MONpod)
@@ -1274,7 +1274,7 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
12741274

12751275
// This test is already covered in pkg/manifests/manifests_test.go::TestRemoteWriteAuthorizationConfig
12761276
// author: [email protected]
1277-
/* g.It("Author:tagao-Medium-50008-Expose sigv4 settings for remote write in the CMO configuration [Serial]", func() {
1277+
/* g.It("Author:tagao-Medium-50008-Expose sigv4 settings for remote write in the CMO configuration [Serial]", func() {
12781278
var (
12791279
sigv4ClusterCM = filepath.Join(monitoringBaseDir, "sigv4-cluster-monitoring-cm.yaml")
12801280
sigv4UwmCM = filepath.Join(monitoringBaseDir, "sigv4-uwm-monitoring-cm.yaml")
@@ -1330,7 +1330,7 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
13301330

13311331
// This test is already covered in pkg/manifests/manifests_test.go::TestPrometheusK8sRemoteWriteOauth2
13321332
// author: [email protected]
1333-
/* g.It("Author:tagao-Medium-49694-Expose OAuth2 settings for remote write in the CMO configuration [Serial]", func() {
1333+
/* g.It("Author:tagao-Medium-49694-Expose OAuth2 settings for remote write in the CMO configuration [Serial]", func() {
13341334
var (
13351335
oauth2ClusterCM = filepath.Join(monitoringBaseDir, "oauth2-cluster-monitoring-cm.yaml")
13361336
oauth2UwmCM = filepath.Join(monitoringBaseDir, "oauth2-uwm-monitoring-cm.yaml")
@@ -1380,7 +1380,7 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
13801380

13811381
// This test is already covered in pkg/manifests/manifests_test.go::TestAlertmanagerConfigPipeline
13821382
1383-
/* g.It("Author:tagao-Medium-47519-Platform prometheus operator should reconcile AlertmanagerConfig resources from user namespaces [Serial]", func() {
1383+
/* g.It("Author:tagao-Medium-47519-Platform prometheus operator should reconcile AlertmanagerConfig resources from user namespaces [Serial]", func() {
13841384
var (
13851385
enableAltmgrConfig = filepath.Join(monitoringBaseDir, "enableUserAlertmanagerConfig.yaml")
13861386
wechatConfig = filepath.Join(monitoringBaseDir, "exampleAlertConfigAndSecret.yaml")
@@ -1437,7 +1437,7 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
14371437
}) */
14381438

14391439
// This test is already covered in pkg/manifests/manifests_test.go::TestPrometheusK8sRemoteWriteAuthorizationConfig and test/e2e/prometheus_test.go::TestPrometheusRemoteWrite
1440-
/* g.It("Author:tagao-Medium-49404-Medium-49176-Expose Authorization settings for remote write in the CMO configuration, Add the relabel config to all user-supplied remote_write configurations [Serial]", func() {
1440+
/* g.It("Author:tagao-Medium-49404-Medium-49176-Expose Authorization settings for remote write in the CMO configuration, Add the relabel config to all user-supplied remote_write configurations [Serial]", func() {
14411441
var (
14421442
authClusterCM = filepath.Join(monitoringBaseDir, "auth-cluster-monitoring-cm.yaml")
14431443
authUwmCM = filepath.Join(monitoringBaseDir, "auth-uwm-monitoring-cm.yaml")
@@ -1494,8 +1494,9 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
14941494
checkRmtWrtConfig(oc, "openshift-user-workload-monitoring", "prometheus-user-workload-0", "target_label: cluster_id_1")
14951495
}) */
14961496

1497+
// TODO: remove g.FlakeAttempts(5), just for debugging
14971498
// author: [email protected]
1498-
g.It("Author:tagao-Low-43037-Should not have error for oc adm inspect clusteroperator monitoring command", func() {
1499+
g.It("Author:tagao-Low-43037-Should not have error for oc adm inspect clusteroperator monitoring command", g.FlakeAttempts(5), func() {
14991500
exutil.By("delete must-gather file at the end of case")
15001501
defer exec.Command("bash", "-c", "rm -rf /tmp/must-gather-43037").Output()
15011502

@@ -1713,53 +1714,53 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
17131714

17141715
// This test is already covered by test/e2e/thanos_ruler_test.go::TestUserWorkloadThanosRulerWithAdditionalAlertmanagers and test/e2e/user_workload_monitoring_test.go::TestUserWorkloadMonitoringWithAdditionalAlertmanagerConfigs
17151716
// author: [email protected]
1716-
/* g.It("ConnectedOnly-Author:tagao-Medium-43286-Allow sending alerts to external Alertmanager for user workload monitoring components - enabled in-cluster alertmanager", func() {
1717-
var (
1718-
testAlertmanager = filepath.Join(monitoringBaseDir, "example-alertmanager.yaml")
1719-
exampleAlert = filepath.Join(monitoringBaseDir, "example-alert-rule.yaml")
1720-
exampleAlert2 = filepath.Join(monitoringBaseDir, "leaf-prometheus-rule.yaml")
1721-
)
1722-
exutil.By("create alertmanager and set external alertmanager for prometheus/thanosRuler under openshift-user-workload-monitoring")
1723-
createResourceFromYaml(oc, "openshift-user-workload-monitoring", testAlertmanager)
1724-
defer oc.AsAdmin().WithoutNamespace().Run("delete").Args("alertmanager", "test-alertmanager", "-n", "openshift-user-workload-monitoring").Execute()
1725-
1726-
exutil.By("check alertmanager pod is created")
1727-
alertmanagerTestPodCheck(oc)
1728-
1729-
exutil.By("skip case on disconnected cluster")
1730-
output, err := oc.AsAdmin().Run("get").Args("pod", "alertmanager-test-alertmanager-0", "-n", "openshift-user-workload-monitoring").Output()
1731-
o.Expect(err).NotTo(o.HaveOccurred())
1732-
e2e.Logf("the pod condition: %s", output)
1733-
if output != "{}" && strings.Contains(output, "ImagePullBackOff") {
1734-
g.Skip("This case can not execute on a disconnected cluster!")
1735-
}
1736-
1737-
exutil.By("create example PrometheusRule under user namespace")
1738-
oc.SetupProject()
1739-
ns1 := oc.Namespace()
1740-
createResourceFromYaml(oc, ns1, exampleAlert)
1741-
1742-
exutil.By("create another user namespace then create PrometheusRule with leaf-prometheus label")
1743-
oc.SetupProject()
1744-
ns2 := oc.Namespace()
1745-
createResourceFromYaml(oc, ns2, exampleAlert2)
1746-
1747-
exutil.By("Get token of SA prometheus-k8s")
1748-
token := getSAToken(oc, "prometheus-k8s", "openshift-monitoring")
1749-
1750-
exutil.By("check the user alerts TestAlert1 and TestAlert2 are shown in \"in-cluster alertmanager\" API")
1751-
checkMetric(oc, `https://alertmanager-main.openshift-monitoring.svc:9094/api/v2/alerts?filter={alertname="TestAlert1"}`, token, "TestAlert1", uwmLoadTime)
1752-
checkMetric(oc, `https://alertmanager-main.openshift-monitoring.svc:9094/api/v2/alerts?filter={alertname="TestAlert1"}`, token, `"generatorURL":"https://console-openshift-console.`, uwmLoadTime)
1753-
checkMetric(oc, `https://alertmanager-main.openshift-monitoring.svc:9094/api/v2/alerts?filter={alertname="TestAlert2"}`, token, "TestAlert2", uwmLoadTime)
1754-
checkMetric(oc, `https://alertmanager-main.openshift-monitoring.svc:9094/api/v2/alerts?filter={alertname="TestAlert2"}`, token, `"generatorURL":"https://console-openshift-console.`, uwmLoadTime)
1755-
1756-
exutil.By("check the alerts are also sent to external alertmanager")
1757-
queryFromPod(oc, `http://alertmanager-operated.openshift-user-workload-monitoring.svc:9093/api/v2/alerts?filter={alertname="TestAlert1"}`, token, "openshift-user-workload-monitoring", "thanos-ruler-user-workload-0", "thanos-ruler", "TestAlert1", uwmLoadTime)
1758-
queryFromPod(oc, `http://alertmanager-operated.openshift-user-workload-monitoring.svc:9093/api/v2/alerts?filter={alertname="TestAlert1"}`, token, "openshift-user-workload-monitoring", "thanos-ruler-user-workload-0", "thanos-ruler", `"generatorURL":"https://console-openshift-console.`, uwmLoadTime)
1759-
queryFromPod(oc, `http://alertmanager-operated.openshift-user-workload-monitoring.svc:9093/api/v2/alerts?filter={alertname="TestAlert2"}`, token, "openshift-user-workload-monitoring", "thanos-ruler-user-workload-0", "thanos-ruler", "TestAlert2", uwmLoadTime)
1760-
queryFromPod(oc, `http://alertmanager-operated.openshift-user-workload-monitoring.svc:9093/api/v2/alerts?filter={alertname="TestAlert2"}`, token, "openshift-user-workload-monitoring", "thanos-ruler-user-workload-0", "thanos-ruler", `"generatorURL":"https://console-openshift-console.`, uwmLoadTime)
1761-
})
1762-
*/
1717+
/* g.It("ConnectedOnly-Author:tagao-Medium-43286-Allow sending alerts to external Alertmanager for user workload monitoring components - enabled in-cluster alertmanager", func() {
1718+
var (
1719+
testAlertmanager = filepath.Join(monitoringBaseDir, "example-alertmanager.yaml")
1720+
exampleAlert = filepath.Join(monitoringBaseDir, "example-alert-rule.yaml")
1721+
exampleAlert2 = filepath.Join(monitoringBaseDir, "leaf-prometheus-rule.yaml")
1722+
)
1723+
exutil.By("create alertmanager and set external alertmanager for prometheus/thanosRuler under openshift-user-workload-monitoring")
1724+
createResourceFromYaml(oc, "openshift-user-workload-monitoring", testAlertmanager)
1725+
defer oc.AsAdmin().WithoutNamespace().Run("delete").Args("alertmanager", "test-alertmanager", "-n", "openshift-user-workload-monitoring").Execute()
1726+
1727+
exutil.By("check alertmanager pod is created")
1728+
alertmanagerTestPodCheck(oc)
1729+
1730+
exutil.By("skip case on disconnected cluster")
1731+
output, err := oc.AsAdmin().Run("get").Args("pod", "alertmanager-test-alertmanager-0", "-n", "openshift-user-workload-monitoring").Output()
1732+
o.Expect(err).NotTo(o.HaveOccurred())
1733+
e2e.Logf("the pod condition: %s", output)
1734+
if output != "{}" && strings.Contains(output, "ImagePullBackOff") {
1735+
g.Skip("This case can not execute on a disconnected cluster!")
1736+
}
1737+
1738+
exutil.By("create example PrometheusRule under user namespace")
1739+
oc.SetupProject()
1740+
ns1 := oc.Namespace()
1741+
createResourceFromYaml(oc, ns1, exampleAlert)
1742+
1743+
exutil.By("create another user namespace then create PrometheusRule with leaf-prometheus label")
1744+
oc.SetupProject()
1745+
ns2 := oc.Namespace()
1746+
createResourceFromYaml(oc, ns2, exampleAlert2)
1747+
1748+
exutil.By("Get token of SA prometheus-k8s")
1749+
token := getSAToken(oc, "prometheus-k8s", "openshift-monitoring")
1750+
1751+
exutil.By("check the user alerts TestAlert1 and TestAlert2 are shown in \"in-cluster alertmanager\" API")
1752+
checkMetric(oc, `https://alertmanager-main.openshift-monitoring.svc:9094/api/v2/alerts?filter={alertname="TestAlert1"}`, token, "TestAlert1", uwmLoadTime)
1753+
checkMetric(oc, `https://alertmanager-main.openshift-monitoring.svc:9094/api/v2/alerts?filter={alertname="TestAlert1"}`, token, `"generatorURL":"https://console-openshift-console.`, uwmLoadTime)
1754+
checkMetric(oc, `https://alertmanager-main.openshift-monitoring.svc:9094/api/v2/alerts?filter={alertname="TestAlert2"}`, token, "TestAlert2", uwmLoadTime)
1755+
checkMetric(oc, `https://alertmanager-main.openshift-monitoring.svc:9094/api/v2/alerts?filter={alertname="TestAlert2"}`, token, `"generatorURL":"https://console-openshift-console.`, uwmLoadTime)
1756+
1757+
exutil.By("check the alerts are also sent to external alertmanager")
1758+
queryFromPod(oc, `http://alertmanager-operated.openshift-user-workload-monitoring.svc:9093/api/v2/alerts?filter={alertname="TestAlert1"}`, token, "openshift-user-workload-monitoring", "thanos-ruler-user-workload-0", "thanos-ruler", "TestAlert1", uwmLoadTime)
1759+
queryFromPod(oc, `http://alertmanager-operated.openshift-user-workload-monitoring.svc:9093/api/v2/alerts?filter={alertname="TestAlert1"}`, token, "openshift-user-workload-monitoring", "thanos-ruler-user-workload-0", "thanos-ruler", `"generatorURL":"https://console-openshift-console.`, uwmLoadTime)
1760+
queryFromPod(oc, `http://alertmanager-operated.openshift-user-workload-monitoring.svc:9093/api/v2/alerts?filter={alertname="TestAlert2"}`, token, "openshift-user-workload-monitoring", "thanos-ruler-user-workload-0", "thanos-ruler", "TestAlert2", uwmLoadTime)
1761+
queryFromPod(oc, `http://alertmanager-operated.openshift-user-workload-monitoring.svc:9093/api/v2/alerts?filter={alertname="TestAlert2"}`, token, "openshift-user-workload-monitoring", "thanos-ruler-user-workload-0", "thanos-ruler", `"generatorURL":"https://console-openshift-console.`, uwmLoadTime)
1762+
})
1763+
*/
17631764
// author: [email protected]
17641765
g.It("Author:tagao-ConnectedOnly-Medium-43311-Allow sending alerts to external Alertmanager for user workload monitoring components - disabled in-cluster alertmanager [Serial]", func() {
17651766
var (
@@ -2671,7 +2672,7 @@ var _ = g.Describe("[sig-monitoring] Cluster_Observability parallel monitoring",
26712672

26722673
// This test is already covered in test/e2e/alertmanager_test.go::TestAlertmanagerDisabling
26732674
2674-
/* g.It("Author:tagao-Medium-43106-disable Alertmanager deployment[Serial]", func() {
2675+
/* g.It("Author:tagao-Medium-43106-disable Alertmanager deployment[Serial]", func() {
26752676
var (
26762677
disableAlertmanager = filepath.Join(monitoringBaseDir, "disableAlertmanager.yaml")
26772678
)

0 commit comments

Comments
 (0)