alerting

package
v0.11.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpCreate = iota
	OpUpdate
	OpDelete
)

Variables

This section is empty.

Functions

func CreateRandomSetOfEndpoints

func CreateRandomSetOfEndpoints() map[string]*alertingv1.FullAttachedEndpoint

the flakiest tests you could ever imagine !!!

func ExpectAlertManagerConfigToBeValid

func ExpectAlertManagerConfigToBeValid(
	ctx context.Context,
	env *test.Environment,
	tmpWritePath string,
	writeFile string,
	cfg *config.Config,
	port int,
)

func ExpectConfigEqual

func ExpectConfigEqual(c1, c2 *config.Config, name ...string)

func ExpectConfigNotEqual

func ExpectConfigNotEqual(c1, c2 *config.Config, name ...string)

func ExpectRouterEqual

func ExpectRouterEqual(r1, r2 routing.OpniRouting, name ...string)

func ExpectRouterNotEqual

func ExpectRouterNotEqual(r1, r2 routing.OpniRouting, name ...string)

func ExpectToRecoverConfig

func ExpectToRecoverConfig(router routing.OpniRouting, name ...string)

func GenerateEndpoint

func GenerateEndpoint(genId int, uuid string) *alertingv1.FullAttachedEndpoint

func RunAlertManager

func RunAlertManager(
	e *test.Environment,
	router routing.OpniRouting,
	tmpWritePath string,
	debugFile string,
) (int, context.CancelFunc)

Types

type DefaultNamespaceSubTreeTestcase

type DefaultNamespaceSubTreeTestcase struct {
	Endpoints []*alertingv1.AlertEndpoint
	*codes.Code
}

func CreateRandomDefaultNamespacedTestcases

func CreateRandomDefaultNamespacedTestcases(endpSet map[string]*alertingv1.FullAttachedEndpoint) []DefaultNamespaceSubTreeTestcase

type IndividualEndpointTestcase

type IndividualEndpointTestcase struct {
	EndpointId     string
	UpdateEndpoint *alertingv1.AlertEndpoint
	Op             int
	*codes.Code
}

func CreateRandomIndividualEndpointTestcases

func CreateRandomIndividualEndpointTestcases(endpSet map[string]*alertingv1.FullAttachedEndpoint) []IndividualEndpointTestcase

type MockIntegrationWebhookServer

type MockIntegrationWebhookServer struct {
	EndpointId string
	Webhook    string
	Port       int
	Addr       string
	*sync.RWMutex
	Buffer []*config.WebhookMessage
}

func CreateWebhookServer

func CreateWebhookServer(e *test.Environment, num int) []*MockIntegrationWebhookServer

func NewWebhookMemoryServer

func NewWebhookMemoryServer(e *test.Environment, webHookRoute string) *MockIntegrationWebhookServer

func (*MockIntegrationWebhookServer) ClearBuffer

func (m *MockIntegrationWebhookServer) ClearBuffer()

func (*MockIntegrationWebhookServer) Endpoint

func (*MockIntegrationWebhookServer) GetBuffer

func (*MockIntegrationWebhookServer) GetWebhook

func (m *MockIntegrationWebhookServer) GetWebhook() string

func (*MockIntegrationWebhookServer) WriteBuffer

func (m *MockIntegrationWebhookServer) WriteBuffer(msg *config.WebhookMessage)

type NamespaceSubTreeTestcase

type NamespaceSubTreeTestcase struct {
	Namespace   string
	ConditionId string
	Endpoints   *alertingv1.FullAttachedEndpoints
	Op          int
	*codes.Code
}

func CreateRandomNamespacedTestCases

func CreateRandomNamespacedTestCases(n int, endpSet map[string]*alertingv1.FullAttachedEndpoint) []NamespaceSubTreeTestcase

type NotificationPair

type NotificationPair = lo.Tuple2[*alertingv1.ListNotificationRequest, int]

list request to expect length of notifications

type RoutableDataset

type RoutableDataset struct {
	Routables             []interfaces.Routable
	ExpectedNotifications []NotificationPair
	ExpectedAlarms        []AlarmPair
}

func NewRoutableDataset

func NewRoutableDataset() *RoutableDataset

Jump to

Keyboard shortcuts

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