Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
e2e tests: update name of the K8s resources
Browse files Browse the repository at this point in the history
This commit updates the name of the resources such as Deployments,
StatefulSets, DaemonSet and Pod whereever needed to reflect the new name
in the Helm chart.

Signed-off-by: Imran Pochi <imran@kinvolk.io>
  • Loading branch information
ipochi committed Nov 4, 2020
1 parent 8d28bc1 commit c669822
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
29 changes: 20 additions & 9 deletions test/components/prometheus-operator/prometheus_operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,27 @@ import (
)

const (
namespace = "monitoring"
grafanaDeployment = "prometheus-operator-grafana"
namespace = "monitoring"

grafanaDeployment = "prometheus-operator-grafana"
kubeStateMetricsDeployment = "prometheus-operator-kube-state-metrics"
kubePrometheusStackDeployment = "prometheus-operator-kube-p-operator"

alertManagerStatefulSet = "alertmanager-prometheus-operator-kube-p-alertmanager"
kubePrometheusStackStatefulset = "prometheus-prometheus-operator-kube-p-prometheus"

nodeExporterDaemonSet = "prometheus-operator-prometheus-node-exporter"

alertManagerPvc = "data-alertmanager-prometheus-operator-kube-p-alertmanager-0"
kubePrometheusStackPvc = "data-prometheus-prometheus-operator-kube-p-prometheus-0"
)

func TestPrometheusOperatorDeployment(t *testing.T) {
client := testutil.CreateKubeClient(t)

deployments := []string{
"prometheus-operator-operator",
"prometheus-operator-kube-state-metrics",
kubeStateMetricsDeployment,
kubePrometheusStackDeployment,
grafanaDeployment,
}

Expand All @@ -59,8 +70,8 @@ func TestPrometheusOperatorDeployment(t *testing.T) {
}

statefulSets := []string{
"alertmanager-prometheus-operator-alertmanager",
"prometheus-prometheus-operator-prometheus",
alertManagerStatefulSet,
kubePrometheusStackStatefulset,
}

for _, statefulset := range statefulSets {
Expand All @@ -73,7 +84,7 @@ func TestPrometheusOperatorDeployment(t *testing.T) {
})
}

testutil.WaitForDaemonSet(t, client, namespace, "prometheus-operator-prometheus-node-exporter", testutil.RetryInterval, testutil.TimeoutSlow) //nolint:lll
testutil.WaitForDaemonSet(t, client, namespace, nodeExporterDaemonSet, testutil.RetryInterval, testutil.TimeoutSlow) //nolint:lll
}

//nolint:funlen
Expand Down Expand Up @@ -163,8 +174,8 @@ func TestGrafanaLoadsEnvVars(t *testing.T) {

func TestPrometheusOperatorPVC(t *testing.T) {
pvcs := []string{
"data-alertmanager-prometheus-operator-alertmanager-0",
"data-prometheus-prometheus-operator-prometheus-0",
alertManagerPvc,
kubePrometheusStackPvc,
}

client := testutil.CreateKubeClient(t)
Expand Down
2 changes: 1 addition & 1 deletion test/monitoring/monitoring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestPrometheus(t *testing.T) {
const prometheusPodPort = 9090

p := &testutil.PortForwardInfo{
PodName: "prometheus-prometheus-operator-prometheus-0",
PodName: "prometheus-prometheus-operator-kube-p-prometheus-0",
Namespace: "monitoring",
PodPort: prometheusPodPort,
}
Expand Down

0 comments on commit c669822

Please sign in to comment.