diff --git a/.github/actions/setup-go-mod-private/action.yaml b/.github/actions/setup-go-mod-private/action.yaml index 8e2c31324..d81533bb0 100644 --- a/.github/actions/setup-go-mod-private/action.yaml +++ b/.github/actions/setup-go-mod-private/action.yaml @@ -13,7 +13,7 @@ runs: using: "composite" steps: - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: './test/go.mod' cache: true diff --git a/.github/workflows/branch-build.yml b/.github/workflows/branch-build.yml index 05e9b10bc..5b39d107f 100644 --- a/.github/workflows/branch-build.yml +++ b/.github/workflows/branch-build.yml @@ -46,7 +46,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true @@ -215,7 +215,7 @@ jobs: install-only: true version: latest - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb96ff7e4..51d9b8187 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true @@ -49,7 +49,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' # When the files to be extracted are already present, @@ -76,7 +76,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true @@ -94,7 +94,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index ac624121a..15038280c 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index 5b2e881a3..a7b08ffc4 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -51,7 +51,7 @@ jobs: persist-credentials: false - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true @@ -205,7 +205,7 @@ jobs: persist-credentials: false - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 573d60789..061e04b7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: run: git fetch --force --tags - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true diff --git a/.github/workflows/upload-plugins.yaml b/.github/workflows/upload-plugins.yaml index 60c368480..8597f31ea 100644 --- a/.github/workflows/upload-plugins.yaml +++ b/.github/workflows/upload-plugins.yaml @@ -22,7 +22,7 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true diff --git a/test/cloud-slack-dev-e2e/cloud_slack_dev_e2e_test.go b/test/cloud-slack-dev-e2e/cloud_slack_dev_e2e_test.go index b4e061260..ca7e1fe41 100644 --- a/test/cloud-slack-dev-e2e/cloud_slack_dev_e2e_test.go +++ b/test/cloud-slack-dev-e2e/cloud_slack_dev_e2e_test.go @@ -34,8 +34,6 @@ import ( stringsutil "k8s.io/utils/strings" gqlModel "github.com/kubeshop/botkube-cloud/botkube-cloud-backend/pkg/graphql" - "github.com/kubeshop/botkube/pkg/api" - "github.com/kubeshop/botkube/pkg/bot/interactive" "github.com/kubeshop/botkube/pkg/formatx" ) @@ -380,16 +378,13 @@ func TestCloudSlackE2E(t *testing.T) { t.Log("Testing ping for not connected deployment #2") command = "ping" - expectedBlockMessage := notConnectedMessage(deployment2.Name, deployment2.ID) + expectedMessage = fmt.Sprintf("The cluster %s (id: %s) is not connected.", deployment2.Name, deployment2.ID) tester.PostMessageToBot(t, channel.Identifier(), fmt.Sprintf("%s --cluster-name %s", command, deployment2.Name)) - renderedMsg := interactive.RenderMessage(tester.MDFormatter(), expectedBlockMessage) - renderedMsg = strings.Replace(renderedMsg, "\n", " ", -1) - renderedMsg = strings.TrimSuffix(renderedMsg, " ") - err = tester.WaitForLastInteractiveMessagePostedEqualWithCustomRender(tester.BotUserID(), channel.ID(), renderedMsg) + err = tester.WaitForLastMessageContains(tester.BotUserID(), channel.ID(), expectedMessage) if err != nil { // the new cloud backend not release yet t.Logf("Fallback to the old behavior with message sent at the channel level...") - err = tester.OnChannel().WaitForLastInteractiveMessagePostedEqualWithCustomRender(tester.BotUserID(), channel.ID(), renderedMsg) + err = tester.OnChannel().WaitForLastMessageContains(tester.BotUserID(), channel.ID(), expectedMessage) } require.NoError(t, err) @@ -725,21 +720,6 @@ func createK8sCli(t *testing.T, kubeconfigPath string) *kubernetes.Clientset { return k8sCli } -func notConnectedMessage(name, id string) interactive.CoreMessage { - return interactive.CoreMessage{ - Message: api.Message{ - Sections: []api.Section{ - { - Base: api.Base{ - Header: "Instance not connected", - Description: fmt.Sprintf("The cluster %s (id: %s) is not connected.", name, id), - }, - }, - }, - }, - } -} - func closePage(t *testing.T, name string, page *rod.Page) { t.Helper() err := page.Close() diff --git a/test/commplatform/discord_tester.go b/test/commplatform/discord_tester.go index b22e124cc..af4b190f8 100644 --- a/test/commplatform/discord_tester.go +++ b/test/commplatform/discord_tester.go @@ -93,10 +93,6 @@ func (d *DiscordTester) ThirdChannel() Channel { return d.thirdChannel } -func (d *DiscordTester) MDFormatter() interactive.MDFormatter { - return d.mdFormatter -} - func (d *DiscordTester) InitUsers(t *testing.T) { t.Helper() @@ -415,10 +411,6 @@ func (d *DiscordTester) WaitForLastInteractiveMessagePostedEqual(userID, channel return d.WaitForMessagePosted(userID, channelID, 1, d.AssertEquals(markdown)) } -func (d *DiscordTester) WaitForLastInteractiveMessagePostedEqualWithCustomRender(userID, channelID string, renderedMsg string) error { - return d.WaitForMessagePosted(userID, channelID, 1, d.AssertEquals(renderedMsg)) -} - func (d *DiscordTester) SetTimeout(timeout time.Duration) { d.cfg.MessageWaitTimeout = timeout } diff --git a/test/commplatform/generic.go b/test/commplatform/generic.go index 0f2f96721..58f659bd5 100644 --- a/test/commplatform/generic.go +++ b/test/commplatform/generic.go @@ -43,10 +43,8 @@ type BotDriver interface { BotName() string BotUserID() string TesterUserID() string - MDFormatter() interactive.MDFormatter WaitForInteractiveMessagePostedRecentlyEqual(userID string, channelID string, message interactive.CoreMessage) error WaitForLastInteractiveMessagePostedEqual(userID string, channelID string, message interactive.CoreMessage) error - WaitForLastInteractiveMessagePostedEqualWithCustomRender(userID, channelID string, renderedMsg string) error SetTimeout(timeout time.Duration) Timeout() time.Duration ReplaceBotNamePlaceholder(msg *interactive.CoreMessage, clusterName string) diff --git a/test/commplatform/slack_tester.go b/test/commplatform/slack_tester.go index 61cc9d346..2d619af68 100644 --- a/test/commplatform/slack_tester.go +++ b/test/commplatform/slack_tester.go @@ -172,10 +172,6 @@ func (s *SlackTester) ThirdChannel() Channel { return s.thirdChannel } -func (s *SlackTester) MDFormatter() interactive.MDFormatter { - return s.mdFormatter -} - func (s *SlackTester) PostInitialMessage(t *testing.T, channelName string) { t.Helper() t.Log("Posting welcome message...") @@ -467,9 +463,6 @@ func (s *SlackTester) WaitForLastInteractiveMessagePostedEqual(userID, channelID return s.WaitForInteractiveMessagePosted(userID, channelID, 1, s.AssertEquals(printedBlocks)) } -func (s *SlackTester) WaitForLastInteractiveMessagePostedEqualWithCustomRender(userID, channelID string, renderedMsg string) error { - return s.WaitForMessagePosted(userID, channelID, 1, s.AssertEquals(renderedMsg)) -} func (s *SlackTester) SetTimeout(timeout time.Duration) { s.cfg.MessageWaitTimeout = timeout diff --git a/test/commplatform/teams_tester.go b/test/commplatform/teams_tester.go index 59fa9f822..4b259431a 100644 --- a/test/commplatform/teams_tester.go +++ b/test/commplatform/teams_tester.go @@ -187,10 +187,6 @@ func (s *TeamsTester) ThirdChannel() Channel { return s.thirdChannel } -func (s *TeamsTester) MDFormatter() interactive.MDFormatter { - return s.renderer.MDFormatter() -} - func (s *TeamsTester) PostInitialMessage(t *testing.T, channelName string) { t.Helper() t.Log("Posting welcome message...") @@ -343,10 +339,6 @@ func (s *TeamsTester) WaitForLastInteractiveMessagePostedEqual(userID, channelID return s.waitForAdaptiveCardMessage(userID, channelID, 1, msg) } -func (s *TeamsTester) WaitForLastInteractiveMessagePostedEqualWithCustomRender(_, _, _ string) error { - return errors.New("not implemented") -} - func (s *TeamsTester) WaitForMessagePostedWithFileUpload(_, _ string, _ FileUploadAssertion) error { return errors.New("not implemented") }