testhelper

package
v0.0.0-...-5561049 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireAllMetricsHaveCommonAttributes

func RequireAllMetricsHaveCommonAttributes(t *testing.T, ms []metric.Metric, clusterName string)

func RequireMetric

func RequireMetric(t *testing.T, metrics []metric.Metric, metricName string) metric.Metric

func RequireMetricTag

func RequireMetricTag(t *testing.T, m metric.Metric, tagName, tagValue string)

func RequireMetricValue

func RequireMetricValue(t *testing.T, m metric.Metric, value float64)

func StubSenderFactory

func StubSenderFactory(sender metric.Sender, err error) metric.SenderFactory

Types

type MockKubernetesDiscoveryClient

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

func NewMockKubernetesDiscoveryClient

func NewMockKubernetesDiscoveryClient(availableResourceGroups []string) *MockKubernetesDiscoveryClient

func (*MockKubernetesDiscoveryClient) ServerGroups

func (kdc *MockKubernetesDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error)

type MockKubernetesManager

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

func NewMockKubernetesManager

func NewMockKubernetesManager() *MockKubernetesManager

func (MockKubernetesManager) AppliedContains

func (skm MockKubernetesManager) AppliedContains(
	apiVersion,
	kind,
	appKubernetesIOName,
	appKubernetesIOComponent,
	metadataName string,
	otherChecks ...string,
) bool

func (*MockKubernetesManager) ApplyResources

func (skm *MockKubernetesManager) ApplyResources(resources []client.Object) error

func (MockKubernetesManager) AutotracingComponentContains

func (skm MockKubernetesManager) AutotracingComponentContains(apiVersion, kind, metadataName string, checks ...string) bool

func (MockKubernetesManager) ClusterCollectorDeploymentContains

func (skm MockKubernetesManager) ClusterCollectorDeploymentContains(checks ...string) bool

func (MockKubernetesManager) CollectorConfigMapContains

func (skm MockKubernetesManager) CollectorConfigMapContains(checks ...string) bool

func (MockKubernetesManager) CollectorServiceAccountContains

func (skm MockKubernetesManager) CollectorServiceAccountContains(checks ...string) bool

func (MockKubernetesManager) ConfigMapContains

func (skm MockKubernetesManager) ConfigMapContains(configMapName string, checks ...string) bool

func (*MockKubernetesManager) DeleteResources

func (skm *MockKubernetesManager) DeleteResources(resources []client.Object) error

func (MockKubernetesManager) DeletedContains

func (skm MockKubernetesManager) DeletedContains(
	apiVersion,
	kind,
	appKubernetesIOName,
	appKubernetesIOComponent,
	metadataName string,
	otherChecks ...string,
) bool

func (*MockKubernetesManager) ForAllAppliedYAMLs

func (skm *MockKubernetesManager) ForAllAppliedYAMLs(do func(appliedYAML client.Object))

func (MockKubernetesManager) GetAppliedConfigMap

func (skm MockKubernetesManager) GetAppliedConfigMap(appKubernetesIOComponent, metadataName string) (corev1.ConfigMap, error)

func (MockKubernetesManager) GetAppliedDaemonSet

func (skm MockKubernetesManager) GetAppliedDaemonSet(appKubernetesIOComponent, metadataName string) (appsv1.DaemonSet, error)

func (MockKubernetesManager) GetAppliedDeployment

func (skm MockKubernetesManager) GetAppliedDeployment(appKubernetesIOComponent, metadataName string) (appsv1.Deployment, error)

func (MockKubernetesManager) GetAppliedService

func (skm MockKubernetesManager) GetAppliedService(appKubernetesIOComponent, metadataName string) (corev1.Service, error)

func (MockKubernetesManager) GetAppliedServiceAccount

func (skm MockKubernetesManager) GetAppliedServiceAccount(appKubernetesIOComponent, metadataName string) (corev1.ServiceAccount, error)

func (MockKubernetesManager) GetAppliedYAML

func (skm MockKubernetesManager) GetAppliedYAML(
	apiVersion,
	kind,
	appKubernetesIOName,
	appKubernetesIOComponent,
	metadataName string,
	otherChecks ...string,
) (*unstructured.Unstructured, error)

func (MockKubernetesManager) GetClusterCollectorDeployment

func (skm MockKubernetesManager) GetClusterCollectorDeployment() (appsv1.Deployment, error)

func (MockKubernetesManager) GetCollectorConfigMap

func (skm MockKubernetesManager) GetCollectorConfigMap(configMapName string) (corev1.ConfigMap, error)

func (MockKubernetesManager) GetCollectorServiceAccount

func (skm MockKubernetesManager) GetCollectorServiceAccount() (corev1.ServiceAccount, error)

func (MockKubernetesManager) GetNodeCollectorDaemonSet

func (skm MockKubernetesManager) GetNodeCollectorDaemonSet() (appsv1.DaemonSet, error)

func (MockKubernetesManager) GetProxyDeployment

func (skm MockKubernetesManager) GetProxyDeployment() (appsv1.Deployment, error)

func (MockKubernetesManager) GetProxyPreprocessorRulesConfigMap

func (skm MockKubernetesManager) GetProxyPreprocessorRulesConfigMap() (corev1.ConfigMap, error)

func (MockKubernetesManager) GetProxyService

func (skm MockKubernetesManager) GetProxyService() (corev1.Service, error)

func (MockKubernetesManager) GetUnstructuredClusterCollectorDeployment

func (skm MockKubernetesManager) GetUnstructuredClusterCollectorDeployment() (*unstructured.Unstructured, error)

func (MockKubernetesManager) GetUnstructuredCollectorConfigMap

func (skm MockKubernetesManager) GetUnstructuredCollectorConfigMap(configMapName string) (*unstructured.Unstructured, error)

func (MockKubernetesManager) GetUnstructuredCollectorServiceAccount

func (skm MockKubernetesManager) GetUnstructuredCollectorServiceAccount() (*unstructured.Unstructured, error)

func (MockKubernetesManager) GetUnstructuredLoggingDaemonset

func (skm MockKubernetesManager) GetUnstructuredLoggingDaemonset() (*unstructured.Unstructured, error)

func (MockKubernetesManager) GetUnstructuredNodeCollectorDaemonSet

func (skm MockKubernetesManager) GetUnstructuredNodeCollectorDaemonSet() (*unstructured.Unstructured, error)

func (MockKubernetesManager) GetUnstructuredProxyDeployment

func (skm MockKubernetesManager) GetUnstructuredProxyDeployment() (*unstructured.Unstructured, error)

func (MockKubernetesManager) GetUnstructuredProxyService

func (skm MockKubernetesManager) GetUnstructuredProxyService() (*unstructured.Unstructured, error)

func (MockKubernetesManager) LoggingConfigMapContains

func (skm MockKubernetesManager) LoggingConfigMapContains(checks ...string) bool

func (MockKubernetesManager) LoggingDaemonSetContains

func (skm MockKubernetesManager) LoggingDaemonSetContains(checks ...string) bool

func (MockKubernetesManager) NodeCollectorDaemonSetContains

func (skm MockKubernetesManager) NodeCollectorDaemonSetContains(checks ...string) bool

func (MockKubernetesManager) PixieComponentContains

func (skm MockKubernetesManager) PixieComponentContains(apiVersion, kind, metadataName string, checks ...string) bool

func (MockKubernetesManager) ProxyDeploymentContains

func (skm MockKubernetesManager) ProxyDeploymentContains(checks ...string) bool

func (MockKubernetesManager) ProxyPreprocessorRulesConfigMapContains

func (skm MockKubernetesManager) ProxyPreprocessorRulesConfigMapContains(checks ...string) bool

func (MockKubernetesManager) ProxyServiceContains

func (skm MockKubernetesManager) ProxyServiceContains(checks ...string) bool

type MockSender

type MockSender struct {
	SentMetrics []metric.Metric
	Flushes     int
	Closes      int
}

func (*MockSender) Close

func (e *MockSender) Close()

func (*MockSender) Flush

func (e *MockSender) Flush() error

func (*MockSender) SendMetric

func (e *MockSender) SendMetric(name string, value float64, ts int64, source string, tags map[string]string) error

type StubSender

type StubSender struct {
	SendMetricErr error
	FlushErr      error
}

func (*StubSender) Close

func (s *StubSender) Close()

func (*StubSender) Flush

func (s *StubSender) Flush() error

func (*StubSender) SendMetric

func (s *StubSender) SendMetric(_ string, _ float64, _ int64, _ string, _ map[string]string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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