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

e2e test: fix checkServiceMonitor function #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions tests/e2e/operator_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ var _ = Describe("Deploy Redis", func() {
})

It("should deploy Redis without sentinel, 1 node, with TLS disabled with metrics, service monitor and prometheus rule enabled", func() {
fmt.Printf("Test output")
var duration prometheusv1.Duration = "5m"
redis := &operatorv1alpha1.Redis{
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -621,8 +620,8 @@ func checkServiceMonitor(redis *operatorv1alpha1.Redis) {

Expect(serviceMonitor.Spec.Endpoints[len(serviceMonitor.Spec.Endpoints)-1].Interval).To(Equal(redis.Spec.Metrics.ServiceMonitor.Interval))
Expect(serviceMonitor.Spec.Endpoints[len(serviceMonitor.Spec.Endpoints)-1].ScrapeTimeout).To(Equal(redis.Spec.Metrics.ServiceMonitor.ScrapeTimeout))
Expect(serviceMonitor.Spec.Endpoints[len(serviceMonitor.Spec.Endpoints)-1].RelabelConfigs).To(Equal(redis.Spec.Metrics.ServiceMonitor.Relabellings))
Expect(serviceMonitor.Spec.Endpoints[len(serviceMonitor.Spec.Endpoints)-1].MetricRelabelConfigs).To(Equal(redis.Spec.Metrics.ServiceMonitor.MetricRelabellings))
Expect(serviceMonitor.Spec.Endpoints[len(serviceMonitor.Spec.Endpoints)-1].RelabelConfigs).To(Equal(slices.Collect(redis.Spec.Metrics.ServiceMonitor.Relabellings, func(c *prometheusv1.RelabelConfig) prometheusv1.RelabelConfig { return *c })))
Expect(serviceMonitor.Spec.Endpoints[len(serviceMonitor.Spec.Endpoints)-1].MetricRelabelConfigs).To(Equal(slices.Collect(redis.Spec.Metrics.ServiceMonitor.MetricRelabellings, func(c *prometheusv1.RelabelConfig) prometheusv1.RelabelConfig { return *c })))
Expect(serviceMonitor.Spec.Endpoints[len(serviceMonitor.Spec.Endpoints)-1].HonorLabels).To(Equal(redis.Spec.Metrics.ServiceMonitor.HonorLabels))
for k, v := range redis.Spec.Metrics.ServiceMonitor.AdditionalLabels {
Expect(serviceMonitor.ObjectMeta.Labels).Should(HaveKeyWithValue(k, v))
Expand Down
Loading