Documentation ¶
Overview ¶
Package testreporters holds all the tools necessary to report on tests that are run utilizing the testsetups package
Index ¶
- Constants
- Variables
- func CommonSlackNotificationBlocks(slackClient *slack.Client, ...) []slack.Block
- func MkdirIfNotExists(dirName string) error
- func SendReport(env *environment.Environment, logsPath string, ...) error
- func SendSlackMessage(slackClient *slack.Client, msgOptions ...slack.MsgOption) (string, error)
- func UpdateSlackEnvVars()
- func UploadSlackFile(slackClient *slack.Client, uploadParams slack.FileUploadParameters) error
- func WriteTeardownLogs(env *environment.Environment, optionalTestReporter TestReporter) error
- type TestReporter
Constants ¶
const ( // DefaultArtifactsDir default artifacts dir DefaultArtifactsDir string = "logs" )
Variables ¶
var ( SlackAPIKey = os.Getenv("SLACK_API") SlackChannel = os.Getenv("SLACK_CHANNEL") SlackUserID = os.Getenv("SLACK_USER_ID") )
Values for reporters to use slack to notify user of test end
Functions ¶
func CommonSlackNotificationBlocks ¶ added in v1.4.10
func MkdirIfNotExists ¶ added in v1.4.10
creates a directory if it doesn't already exist
func SendReport ¶ added in v1.4.10
func SendReport(env *environment.Environment, logsPath string, optionalTestReporter TestReporter) error
if provided, writes a test report and sends a Slack notification
func SendSlackMessage ¶ added in v1.4.10
Sends a slack message, and returns an error and the message timestamp
func UpdateSlackEnvVars ¶
func UpdateSlackEnvVars()
UpdateSlackEnvVars updates the slack environment variables in case they are changed while remote test is running. Usually used for unit tests.
func UploadSlackFile ¶ added in v1.4.10
func UploadSlackFile(slackClient *slack.Client, uploadParams slack.FileUploadParameters) error
Uploads a slack file to the designated channel using the API key
func WriteTeardownLogs ¶ added in v1.4.10
func WriteTeardownLogs(env *environment.Environment, optionalTestReporter TestReporter) error
attempts to download the logs of all ephemeral test deployments onto the test runner, also writing a test report if one is provided