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(headerText, namespace, reportCsvLocation string) []slack.Block
- func MkdirIfNotExists(dirName string) error
- func SendReport(t *testing.T, env *environment.Environment, logsPath string, ...) error
- func SendSlackMessage(slackClient *slack.Client, msgOptions ...slack.MsgOption) (string, error)
- func SlackNotifyBlocks(headerText, namespace string, msgtext []string) []slack.Block
- func UploadSlackFile(slackClient *slack.Client, uploadParams slack.FileUploadParameters) error
- func WriteTeardownLogs(t *testing.T, env *environment.Environment, optionalTestReporter TestReporter, ...) error
- type TestReporter
Constants ¶
const ( // DefaultArtifactsDir default artifacts dir DefaultArtifactsDir string = "logs" )
Variables ¶
var ( SlackAPIKey = os.Getenv(config.EnvVarSlackKey) SlackChannel = os.Getenv(config.EnvVarSlackChannel) SlackUserID = os.Getenv(config.EnvVarSlackUser) )
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(t *testing.T, env *environment.Environment, logsPath string, optionalTestReporter TestReporter) error
SendReport writes a test report and sends a Slack notification if the test provides one
func SendSlackMessage ¶ added in v1.4.10
Sends a slack message, and returns an error and the message timestamp
func SlackNotifyBlocks ¶ added in v1.7.2
SlackNotifyBlocks creates a slack payload and writes into the specified json
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( t *testing.T, env *environment.Environment, optionalTestReporter TestReporter, failingLogLevel zapcore.Level, ) error
WriteTeardownLogs attempts to download the logs of all ephemeral test deployments onto the test runner, also writing a test report if one is provided. A failing log level also enables you to fail a test based on what level logs the Chainlink nodes have thrown during their test.