Skip to content

Commit

Permalink
Add missing envs
Browse files Browse the repository at this point in the history
  • Loading branch information
pkosiec committed Sep 21, 2023
1 parent e4d3e7f commit eaa46ae
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/cl-migration-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ on:
repository_dispatch:
types: [ trigger-e2e-tests ]

env:
HELM_VERSION: v3.9.0
K3D_VERSION: v5.4.6
IMAGE_REGISTRY: "ghcr.io"
IMAGE_REPOSITORY: "kubeshop/botkube"
IMAGE_TAG: v9.99.9-dev # TODO: Use commit hash tag to make the predictable builds for each commit on branch

jobs:
migration-e2e-test:
name: Migration e2e test
Expand Down
24 changes: 18 additions & 6 deletions test/commplatform/slack_tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import (
)

type SlackConfig struct {
BotName string `envconfig:"default=botkube"`
TesterName string `envconfig:"default=tester"`
AdditionalContextMessage string `envconfig:"optional"`
TesterAppToken string
CloudTesterAppToken string
BotName string `envconfig:"default=botkube"`
TesterName string `envconfig:"default=tester"`
AdditionalContextMessage string `envconfig:"optional"`
TesterAppToken string `envconfig:"optional"`
TesterBotToken string `envconfig:"optional"`
CloudTesterAppToken string `envconfig:"optional"`
RecentMessagesLimit int `envconfig:"default=6"`
MessageWaitTimeout time.Duration `envconfig:"default=30s"`
}
Expand Down Expand Up @@ -57,7 +58,18 @@ type SlackTester struct {
}

func NewSlackTester(slackCfg SlackConfig) (BotDriver, error) {
slackCli := slack.New(slackCfg.TesterAppToken)
var token string
if slackCfg.TesterAppToken == "" && slackCfg.TesterBotToken == "" {
return nil, errors.New("slack tester token is not set")
}
if slackCfg.TesterAppToken != "" {
token = slackCfg.TesterAppToken
}
if slackCfg.TesterBotToken != "" {
token = slackCfg.TesterBotToken
}

slackCli := slack.New(token)
_, err := slackCli.AuthTest()
if err != nil {
return nil, err
Expand Down

0 comments on commit eaa46ae

Please sign in to comment.