Documentation ¶
Index ¶
- Constants
- func CreateRandomSetOfEndpoints() map[string]*alertingv1.FullAttachedEndpoint
- func ExpectAlertManagerConfigToBeValid(ctx context.Context, env *test.Environment, tmpWritePath string, ...)
- func ExpectConfigEqual(c1, c2 *config.Config, name ...string)
- func ExpectConfigNotEqual(c1, c2 *config.Config, name ...string)
- func ExpectRouterEqual(r1, r2 routing.OpniRouting, name ...string)
- func ExpectRouterNotEqual(r1, r2 routing.OpniRouting, name ...string)
- func ExpectToRecoverConfig(router routing.OpniRouting, name ...string)
- func GenerateEndpoint(genId int, uuid string) *alertingv1.FullAttachedEndpoint
- func RunAlertManager(e *test.Environment, router routing.OpniRouting, tmpWritePath string, ...) (int, context.CancelFunc)
- type AlarmPair
- type DefaultNamespaceSubTreeTestcase
- type IndividualEndpointTestcase
- type MockIntegrationWebhookServer
- type NamespaceSubTreeTestcase
- type NotificationPair
- type RoutableDataset
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 ExpectConfigEqual ¶
func ExpectConfigNotEqual ¶
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 AlarmPair ¶
type AlarmPair = lo.Tuple2[*alertingv1.ListAlarmMessageRequest, int]
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 ¶
func CreateWebhookServer ¶
func CreateWebhookServer(num int) []*MockIntegrationWebhookServer
func NewWebhookMemoryServer ¶
func NewWebhookMemoryServer(webHookRoute string) *MockIntegrationWebhookServer
func (*MockIntegrationWebhookServer) Endpoint ¶
func (m *MockIntegrationWebhookServer) Endpoint() *alertingv1.AlertEndpoint
func (*MockIntegrationWebhookServer) GetWebhook ¶
func (m *MockIntegrationWebhookServer) GetWebhook() string
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
Click to show internal directories.
Click to hide internal directories.