testutils

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertMetricsDouble added in v0.47.0

func AssertMetricsDouble(t *testing.T, actualMetric *metricspb.Metric, expectedMetric string,
	expectedType metricspb.MetricDescriptor_Type, expectedValue float64)

func AssertMetricsInt added in v0.47.0

func AssertMetricsInt(t *testing.T, actualMetric *metricspb.Metric, expectedMetric string,
	expectedType metricspb.MetricDescriptor_Type, expectedValue int64)

func AssertMetricsWithLabels

func AssertMetricsWithLabels(t *testing.T, actualMetric *metricspb.Metric,
	expectedMetric string, expectedType metricspb.MetricDescriptor_Type,
	expectedLabels map[string]string, expectedValue int64)

func AssertResource

func AssertResource(t *testing.T, actualResource *resourcepb.Resource,
	expectedType string, expectedLabels map[string]string)

func NewDaemonset added in v0.71.0

func NewDaemonset(id string) *appsv1.DaemonSet

func NewDeployment added in v0.71.0

func NewDeployment(id string) *appsv1.Deployment

func NewHPA added in v0.71.0

func NewJob added in v0.71.0

func NewJob(id string) *batchv1.Job

func NewNode added in v0.71.0

func NewNode(id string) *corev1.Node

func NewPodSpecWithContainer added in v0.71.0

func NewPodSpecWithContainer(containerName string) *corev1.PodSpec

func NewPodStatusWithContainer added in v0.71.0

func NewPodStatusWithContainer(containerName, containerID string) *corev1.PodStatus

func NewPodWithContainer added in v0.71.0

func NewPodWithContainer(id string, spec *corev1.PodSpec, status *corev1.PodStatus) *corev1.Pod

func NewReplicaSet added in v0.71.0

func NewReplicaSet(id string) *appsv1.ReplicaSet

func WithOwnerReferences added in v0.71.0

func WithOwnerReferences(or []v1.OwnerReference, obj interface{}) interface{}

Types

type MockStore

type MockStore struct {
	cache.Store
	WantErr bool
	Cache   map[string]interface{}
}

func (*MockStore) GetByKey

func (ms *MockStore) GetByKey(id string) (interface{}, bool, error)

func (*MockStore) List

func (ms *MockStore) List() []interface{}

Jump to

Keyboard shortcuts

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