Documentation
¶
Index ¶
- Constants
- Variables
- func CheckManifestFile(t *testing.T, container testcontainers.Container, ...)
- func ClearManagementPlaneResponses(t *testing.T, mockManagementPlaneAPIAddress string)
- func CreateContainerNetwork(ctx context.Context, tb testing.TB) *testcontainers.DockerNetwork
- func CurrentFileOverview(t *testing.T, nginxInstanceID, mockManagementPlaneAPIAddress string) *mpi.FileOverview
- func GenerateMetrics(ctx context.Context, t *testing.T, container testcontainers.Container, ...)
- func ManagementPlaneResponses(t *testing.T, numberOfExpectedResponses int, ...) []*mpi.DataPlaneResponse
- func PerformConfigApply(t *testing.T, nginxInstanceID, mockManagementPlaneAPIAddress string)
- func PerformInvalidConfigApply(t *testing.T, nginxInstanceID string)
- func PollingForMetrics(t *testing.T, ctx context.Context, metricName string, labelFilter LabelFilter, ...) []float64
- func ScrapeCollectorMetricFamilies(t *testing.T, ctx context.Context, otelContainer testcontainers.Container) map[string]*dto.MetricFamily
- func SetupConnectionTest(tb testing.TB, expectNoErrorsInLogs, nginxless, auxiliaryServer bool, ...) func(tb testing.TB)
- func SetupMetricsTest(tb testing.TB) func(testing.TB)
- func SetupMockManagementPlaneGrpc(ctx context.Context, tb testing.TB, ...)
- func SumMetricFamily(metricFamily *dto.MetricFamily) float64
- func SumMetricFamilyLabel(metricFamily *dto.MetricFamily, key, val string) float64
- func VerifyConnection(t *testing.T, instancesLength int, mockManagementPlaneAPIAddress string) string
- func VerifyUpdateDataPlaneHealth(t *testing.T, mockManagementPlaneAPIAddress string)
- func VerifyUpdateDataPlaneStatus(t *testing.T, mockManagementPlaneAPIAddress string)
- func WaitForMetricsToExist(t *testing.T, ctx context.Context)
- func WaitUntilNextScrapeCycle(t *testing.T, ctx context.Context)
- func WriteConfigFileDataplane(t *testing.T, file1, file2, file3 string)
- func WriteConfigFileMock(t *testing.T, nginxInstanceID, file1, file2, file3 string)
- type ConnectionRequest
- type Instance
- type LabelFilter
- type NginxUpdateDataPlaneHealthRequest
- type UpdateDataPlaneStatusRequest
Constants ¶
View Source
const ( RetryCount = 10 RetryWaitTime = 5 * time.Second RetryMaxWaitTime = 1 * time.Minute )
Variables ¶
View Source
var ( MockManagementPlaneAPIAddress string AuxiliaryMockManagementPlaneAPIAddress string )
View Source
var ( Container testcontainers.Container MockManagementPlaneGrpcContainer testcontainers.Container AuxiliaryMockManagementPlaneGrpcContainer testcontainers.Container MockManagementPlaneGrpcAddress string AuxiliaryMockManagementPlaneGrpcAddress string )
View Source
var MockCollectorStack *helpers.MockCollectorContainers
Functions ¶
func CheckManifestFile ¶ added in v3.3.1
func CheckManifestFile(t *testing.T, container testcontainers.Container, expectedContent map[string]*model.ManifestFile, )
func CreateContainerNetwork ¶ added in v3.3.1
CreateContainerNetwork creates and configures a container network.
func CurrentFileOverview ¶ added in v3.2.0
func CurrentFileOverview(t *testing.T, nginxInstanceID, mockManagementPlaneAPIAddress string) *mpi.FileOverview
func GenerateMetrics ¶ added in v3.4.0
func PerformConfigApply ¶
func PollingForMetrics ¶ added in v3.4.0
func ScrapeCollectorMetricFamilies ¶ added in v3.4.0
func SetupConnectionTest ¶
func SetupMockManagementPlaneGrpc ¶ added in v3.3.1
func SetupMockManagementPlaneGrpc(ctx context.Context, tb testing.TB, containerNetwork *testcontainers.DockerNetwork)
SetupMockManagementPlaneGrpc initializes the mock management plane gRPC container.
func SumMetricFamily ¶ added in v3.4.0
func SumMetricFamily(metricFamily *dto.MetricFamily) float64
SumMetricFamily retrieves the sum of the metric values in a MetricFamily
func SumMetricFamilyLabel ¶ added in v3.4.0
func SumMetricFamilyLabel(metricFamily *dto.MetricFamily, key, val string) float64
SumMetricFamilyLabel retrieves the sum of the metric values for a specific label in a MetricFamily
func VerifyConnection ¶
func WaitForMetricsToExist ¶ added in v3.4.0
func WaitUntilNextScrapeCycle ¶ added in v3.4.0
func WriteConfigFileDataplane ¶ added in v3.3.1
func WriteConfigFileMock ¶ added in v3.3.1
Types ¶
type ConnectionRequest ¶
type ConnectionRequest struct {
ConnectionRequest *mpi.CreateConnectionRequest `json:"connectionRequest"`
}
type Instance ¶
type Instance struct {
InstanceMeta *mpi.InstanceMeta `json:"instance_meta"`
InstanceRuntime *mpi.InstanceRuntime `json:"instance_runtime"`
}
type LabelFilter ¶ added in v3.4.0
type NginxUpdateDataPlaneHealthRequest ¶
type NginxUpdateDataPlaneHealthRequest struct {
MessageMeta *mpi.MessageMeta `json:"message_meta"`
Instances []Instance `json:"instances"`
}
type UpdateDataPlaneStatusRequest ¶
type UpdateDataPlaneStatusRequest struct {
UpdateDataPlaneStatusRequest NginxUpdateDataPlaneHealthRequest `json:"updateDataPlaneStatusRequest"`
}
Click to show internal directories.
Click to hide internal directories.