notifier

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RenderTestSummaryInput

type RenderTestSummaryInput struct {
	TestResultWindowTime time.Duration
	TotalTestsCnt        int
	FailedTests          []internal.TestStatus
	TestRunnerInfo       TestRunnerInfo
}

RenderTestSummaryInput holds input parameters required to render test summary

type SlackClient

type SlackClient struct {
	// contains filtered or unexported fields
}

SlackClient sends message to slack channel

func NewSlackClient

func NewSlackClient(cfg SlackClientConfig) *SlackClient

NewSlackClient returns new instance of SlackClient

func (*SlackClient) Send

func (c *SlackClient) Send(header, body, footer, color string) error

Send sends message with given content to slack channel

type SlackClientConfig

type SlackClientConfig struct {
	ChannelID  string
	WebhookURL string
	Token      string
}

SlackClientConfig holds configuration for slack client

type SlackNotifier

type SlackNotifier struct {
	// contains filtered or unexported fields
}

SlackNotifier sends notification about test result to Slack channel.

func New

func New(
	slack slackClient,
	testRenderer testRenderer,
	cfgMapClient configMapClient,
	cfgMapName string,
	resultWindowTime time.Duration,
	testRunnerPodName, testRunnerNamespace string,
	log logrus.FieldLogger) *SlackNotifier

New returns new instance of SlackNotifier

func (*SlackNotifier) Run

func (s *SlackNotifier) Run(ctx context.Context)

Run sends in a loop notification about test result to Slack channel

type TestRenderer

type TestRenderer struct {
	// contains filtered or unexported fields
}

TestRenderer renders test summary

func NewTestRenderer

func NewTestRenderer() (*TestRenderer, error)

NewTestRenderer returns new instance of TestRenderer

func (*TestRenderer) RenderTestSummary

func (s *TestRenderer) RenderTestSummary(in RenderTestSummaryInput) (string, string, string, error)

RenderTestSummary returns header and body summary of given tests

type TestRunnerInfo

type TestRunnerInfo struct {
	PodName   string
	Namespace string
}

TestRunnerInfo describes test runner in kubernetes system

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL