test

package
v2.10.9 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

View Source
const (
	FakeArgoCDNamespace = "fake-argocd-ns"
	FakeDestNamespace   = "fake-dest-ns"
	FakeClusterURL      = "https://fake-cluster:443"
)

Variables

View Source
var ConfigMapManifest = `` /* 162-byte string literal not displayed */
View Source
var DeploymentManifest = `` /* 627-byte string literal not displayed */

Functions

func CaptureLogEntries added in v2.9.0

func CaptureLogEntries(run func()) string

CaptureLogEntries captures log entries generated by the logger and return it as string

func GetFreePort

func GetFreePort() (int, error)

GetFreePort finds an available free port on the OS

func GetTestDir added in v2.4.0

func GetTestDir(t *testing.T) string

GetTestDir will return the full directory path of the calling test file.

func MustLoadFileToString

func MustLoadFileToString(path string) string

Read the contents of a file and returns it as string. Panics on error.

func NewConfigMap added in v2.9.0

func NewConfigMap() *unstructured.Unstructured

func NewControllerRevision

func NewControllerRevision() *unstructured.Unstructured

func NewDeployment

func NewDeployment() *unstructured.Unstructured

func NewFakeConfigMap

func NewFakeConfigMap() *apiv1.ConfigMap

func NewFakeProjLister

func NewFakeProjLister(objects ...runtime.Object) applister.AppProjectNamespaceLister

func NewFakeSecret

func NewFakeSecret(policy ...string) *apiv1.Secret

func NewInMemoryRedis

func NewInMemoryRedis() (*redis.Client, func())

func StartInformer

func StartInformer(informer cache.SharedIndexInformer) context.CancelFunc

StartInformer is a helper to start an informer, wait for its cache to sync and return a cancel func

func ToMap added in v2.6.0

func ToMap(obj interface{}) map[string]interface{}

ToMap converts any object to a map[string]interface{}

func WaitForPortListen

func WaitForPortListen(addr string, timeout time.Duration) error

WaitForPortListen waits until the given address is listening on the port

func YamlToUnstructured added in v2.3.0

func YamlToUnstructured(yamlStr string) *unstructured.Unstructured

Types

This section is empty.

Jump to

Keyboard shortcuts

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