From 5c7dad2d8fd5d903a1ba34ca7e4aedc154d84936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kosiec?= Date: Thu, 10 Nov 2022 17:32:40 +0100 Subject: [PATCH] Fix tests --- helm/botkube/e2e-test-values.yaml | 40 +++++-------------- .../TestLoadConfigSuccess/config.golden.yaml | 2 +- test/e2e/slack_driver_test.go | 5 ++- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/helm/botkube/e2e-test-values.yaml b/helm/botkube/e2e-test-values.yaml index 1fe377e021..f672849a28 100644 --- a/helm/botkube/e2e-test-values.yaml +++ b/helm/botkube/e2e-test-values.yaml @@ -17,30 +17,7 @@ communications: - kubectl-allow-all sources: - k8s-events - 'secondary': - name: "" # Tests will override this temporarily - notification: - disabled: true - bindings: - executors: - - kubectl-read-only - sources: - - k8s-updates - socketSlack: # Configuration for the Slack app with Socket Mode support - enabled: false # Tests will override this temporarily - botToken: "" # Provide a botToken for custom slack app - appToken: "" # Provide an appToken for custom slack app - channels: - 'default': - name: "" # Tests will override this temporarily - bindings: - executors: - - kubectl-read-only - - kubectl-wait-cmd - - kubectl-exec-cmd - - kubectl-allow-all - sources: - - k8s-events + - k8s-pod-create-events 'secondary': name: "" # Tests will override this temporarily notification: @@ -65,6 +42,7 @@ communications: - kubectl-allow-all sources: - k8s-events + - k8s-pod-create-events 'secondary': id: "" # Tests will override this channel ID temporarily notification: @@ -83,13 +61,6 @@ sources: namespaces: include: - botkube - recommendations: - pod: - noLatestImageTag: true - labelsSet: true - ingress: - backendServiceValid: false - tlsSecretValid: false events: - create - update @@ -97,6 +68,13 @@ sources: resources: - name: v1/configmaps 'k8s-pod-create-events': + recommendations: + pod: + noLatestImageTag: true + labelsSet: true + ingress: + backendServiceValid: false + tlsSecretValid: false kubernetes: namespaces: include: diff --git a/pkg/config/testdata/TestLoadConfigSuccess/config.golden.yaml b/pkg/config/testdata/TestLoadConfigSuccess/config.golden.yaml index fe642dbcee..3c304b205c 100644 --- a/pkg/config/testdata/TestLoadConfigSuccess/config.golden.yaml +++ b/pkg/config/testdata/TestLoadConfigSuccess/config.golden.yaml @@ -418,7 +418,7 @@ settings: port: 0 deployment: {} log: - level: info + level: error disableColors: false informersResyncPeriod: 30m0s kubeconfig: kubeconfig-from-env diff --git a/test/e2e/slack_driver_test.go b/test/e2e/slack_driver_test.go index 1c536d4358..3e369fc1a7 100644 --- a/test/e2e/slack_driver_test.go +++ b/test/e2e/slack_driver_test.go @@ -273,7 +273,10 @@ func (s *slackTester) WaitForMessagePostedWithAttachment(userID, channelID strin var fetchedMessages []slack.Message var lastErr error var diffMessage string - highestCommonBlockCount := -1 // a single message is fetched, always print diff + var highestCommonBlockCount int + if limitMessages == 1 { + highestCommonBlockCount = -1 // a single message is fetched, always print diff + } err := wait.Poll(pollInterval, s.cfg.MessageWaitTimeout, func() (done bool, err error) { historyRes, err := s.cli.GetConversationHistory(&slack.GetConversationHistoryParameters{