testutils

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Interval = 2 * time.Second
View Source
const Timeout = 30 * time.Second

Variables

This section is empty.

Functions

func AssertNoEvents

func AssertNoEvents(t *testing.T, rec *events.FakeRecorder)

AssertNoEvents fails t if rec has any buffered events.

func ExpectNotRecreated added in v1.1.3

func ExpectNotRecreated(ctx context.Context, c client.Client, obj client.Object)

ExpectNotRecreated asserts that a controller does not recreate obj, deleting it again whenever it reappears until it has stayed absent for several polls.

A reconcile that read the owner before its deletionTimestamp was visible can still be in flight and recreate obj once, and how long that straggler takes varies by runner speed, so a fixed window is inherently flaky. Draining stragglers instead still fails on a genuine regression, where obj is recreated for as long as the timeout allows.

func GenerateResourceName

func GenerateResourceName(length int) string

REGEX: `[a-z]([-a-z0-9]*[a-z0-9])?`

func GetEnvTestBinary

func GetEnvTestBinary(rootPath string) string

func NewAccounting

func NewAccounting(name string, slurmKeyRef, jwtKeyRef corev1.SecretKeySelector, passwordRef corev1.SecretKeySelector) *slinkyv1beta1.Accounting

func NewController

func NewController(name string, slurmKeyRef, jwtKeyRef corev1.SecretKeySelector, accounting *slinkyv1beta1.Accounting) *slinkyv1beta1.Controller

func NewJwtKeyRef added in v1.1.0

func NewJwtKeyRef(name string) corev1.SecretKeySelector

func NewJwtKeySecret added in v1.1.0

func NewJwtKeySecret(ref corev1.SecretKeySelector) *corev1.Secret

func NewLoginset

func NewLoginset(name string, controller *slinkyv1beta1.Controller, sssdConfRef corev1.SecretKeySelector) *slinkyv1beta1.LoginSet

func NewNodeset

func NewNodeset(name string, controller *slinkyv1beta1.Controller, replicas int32) *slinkyv1beta1.NodeSet

func NewPasswordRef

func NewPasswordRef(name string) corev1.SecretKeySelector

func NewPasswordSecret

func NewPasswordSecret(ref corev1.SecretKeySelector) *corev1.Secret

func NewRestapi

func NewRestapi(name string, controller *slinkyv1beta1.Controller) *slinkyv1beta1.RestApi

func NewSlurmKeyRef

func NewSlurmKeyRef(name string) corev1.SecretKeySelector

func NewSlurmKeySecret

func NewSlurmKeySecret(ref corev1.SecretKeySelector) *corev1.Secret

func NewSssdConfRef

func NewSssdConfRef(name string) corev1.SecretKeySelector

func NewSssdConfSecret

func NewSssdConfSecret(ref corev1.SecretKeySelector) *corev1.Secret

func NewToken

func NewToken(name string, jwtKeySecret *corev1.Secret) *slinkyv1beta1.Token

func ReadOneEvent

func ReadOneEvent(t *testing.T, rec *events.FakeRecorder) string

ReadOneEvent returns the next event buffered on rec, failing t if there is none.

Types

This section is empty.

Jump to

Keyboard shortcuts

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