test

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	At         = testutils.At
	Between    = testutils.Between
	Alert      = testutils.Alert
	NewWebhook = testutils.NewWebhook
)
View Source
var CompareCollectors = testutils.CompareCollectors

Functions

This section is empty.

Types

type AcceptanceOpts

type AcceptanceOpts = testutils.AcceptanceOpts

Re-export common types and functions from testutils.

type AcceptanceTest

type AcceptanceTest struct {
	*testutils.AcceptanceTest
}

AcceptanceTest wraps testutils.AcceptanceTest for API-based testing.

func NewAcceptanceTest

func NewAcceptanceTest(t *testing.T, opts *AcceptanceOpts) *AcceptanceTest

NewAcceptanceTest returns a new acceptance test.

func (*AcceptanceTest) AlertmanagerCluster

func (t *AcceptanceTest) AlertmanagerCluster(conf string, size int) *AlertmanagerCluster

AlertmanagerCluster returns a new AlertmanagerCluster.

type Alertmanager

type Alertmanager struct {
	*testutils.Alertmanager
}

Alertmanager wraps testutils.Alertmanager and adds API-specific methods.

func (*Alertmanager) DelSilence

func (am *Alertmanager) DelSilence(at float64, sil *TestSilence)

DelSilence deletes the silence with the sid at the given time.

func (*Alertmanager) Push

func (am *Alertmanager) Push(at float64, alerts ...*TestAlert)

Push declares alerts that are to be pushed to the Alertmanager server at a relative point in time.

func (*Alertmanager) SetSilence

func (am *Alertmanager) SetSilence(at float64, sil *TestSilence)

SetSilence updates or creates the given Silence.

type AlertmanagerCluster

type AlertmanagerCluster struct {
	*testutils.AlertmanagerCluster
}

AlertmanagerCluster wraps testutils.AlertmanagerCluster and adds API-specific methods.

func (*AlertmanagerCluster) DelSilence

func (amc *AlertmanagerCluster) DelSilence(at float64, sil *TestSilence)

DelSilence deletes the silence with the sid at the given time.

func (*AlertmanagerCluster) Members added in v0.17.0

func (amc *AlertmanagerCluster) Members() []*Alertmanager

Members returns the underlying Alertmanager instances wrapped for API testing.

func (*AlertmanagerCluster) Push

func (amc *AlertmanagerCluster) Push(at float64, alerts ...*TestAlert)

Push declares alerts that are to be pushed to the Alertmanager servers at a relative point in time.

func (*AlertmanagerCluster) SetSilence

func (amc *AlertmanagerCluster) SetSilence(at float64, sil *TestSilence)

SetSilence updates or creates the given Silence.

type Collector

type Collector = testutils.Collector

Re-export common types and functions from testutils.

type Interval

type Interval = testutils.Interval

Re-export common types and functions from testutils.

type MockWebhook

type MockWebhook = testutils.MockWebhook

Re-export common types and functions from testutils.

type TestAlert

type TestAlert = testutils.TestAlert

Re-export common types and functions from testutils.

type TestSilence

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

TestSilence models a model.Silence with relative times.

func Silence

func Silence(start, end float64) *TestSilence

Silence creates a new TestSilence active for the relative interval given by start and end.

func (*TestSilence) ID

func (s *TestSilence) ID() string

ID gets the silence ID.

func (*TestSilence) Match

func (s *TestSilence) Match(v ...string) *TestSilence

Match adds a new plain matcher to the silence.

func (*TestSilence) MatchRE

func (s *TestSilence) MatchRE(v ...string) *TestSilence

MatchRE adds a new regex matcher to the silence.

func (*TestSilence) SetID

func (s *TestSilence) SetID(ID string)

SetID sets the silence ID.

Jump to

Keyboard shortcuts

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