Documentation
¶
Overview ¶
Package slack contains routines useful for testing slack integrations.
Deprecated: The slack package is scheduled for removal in Terratest v2. Slack validation is out of scope for an infrastructure testing library; use the github.com/slack-go/slack client directly if you need it. There is no public replacement; the package is being dropped.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateExpectedSlackMessageE
deprecated
func ValidateExpectedSlackMessageE( t testing.TestingT, token, channelID, expectedText string, historyLimit int, lookBack time.Duration, ) error
ValidateExpectedSlackMessageE validates whether a message containing the expected text was posted in the given channel ID, looking back historyLimit messages up to the given duration. For example, if you set (15*time.Minute) as the lookBack parameter with historyLimit set to 50, then this will look back the last 50 messages, up to 15 minutes ago. This expects a slack token to be provided. This returns MessageNotFoundErr when there is no match. For the purposes of matching, this only checks the following blocks: - Section block text - Header block text All other blocks are ignored in the validation. NOTE: This only looks for bot posted messages.
Deprecated: scheduled for removal in Terratest v2. Use the slack-go client directly, e.g.:
client := slack.New(token)
resp, err := client.GetConversationHistory(&slack.GetConversationHistoryParameters{
ChannelID: channelID,
Limit: historyLimit,
})
// then scan resp.Messages for the expected text.
Types ¶
type MessageNotFoundErr
deprecated
type MessageNotFoundErr struct{}
MessageNotFoundErr is returned when the expected text cannot be found in any of the messages posted in a Slack channel.
Deprecated: scheduled for removal in Terratest v2 along with the slack package.
func (MessageNotFoundErr) Error ¶
func (err MessageNotFoundErr) Error() string