test

package
v1.1.4 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: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Testenv         env.Environment
	TestUID         string
	SlinkyNamespace string = "slinky"
	Basepath        string
	SlurmImage      SlurmImageConfig
)

Functions

func CaptureFailureDiagnostics

func CaptureFailureDiagnostics(t *testing.T, failure string, namespaces ...string) string

CaptureFailureDiagnostics writes a compact snapshot of the cluster while the resources involved in a failed E2E scenario still exist. Diagnostic failures are recorded in the artifact files but never obscure the original test error.

func CheckDeploymentStatus

func CheckDeploymentStatus(ctx context.Context, t *testing.T, config *envconf.Config, deploymentName string, deploymentNamespace string) context.Context

CheckDeploymentStatus waits for the specified deployment to have the desired number of ReadyReplicas, then returns

func DoDeleteNamespace

func DoDeleteNamespace(ctx context.Context, t *testing.T, config *envconf.Config, namespace string) context.Context

DoDeleteNamespace deletes the specified namespace and waits for its removal.

func DoUninstallHelmChart

func DoUninstallHelmChart(ctx context.Context, t *testing.T, config *envconf.Config, chartName string, chartNamespace string) context.Context

DoUninstallHelmChart uses the Helm API to uninstall the specified Helm chart in the specified namespace

func GetBasePath

func GetBasePath() string

getBasePath returns the fully qualified path of the slurm-operator repo within the context in which `go test` is called

func GetSlurmNodeInfo

func GetSlurmNodeInfo(namespace, nodeName string) (map[string]string, error)

GetSlurmNodeInfo uses scontrol to get details on a Slurm node

func StatusJSON

func StatusJSON(status any) string

StatusJSON renders Kubernetes status structs compactly for failure messages.

func StringToMap

func StringToMap(input string) map[string]string

StringToMap converts the provided string to a map. Assumes that key-value pairs are separated by spaces, and that keys and values are separated by an equals sign

func WaitForCommand

func WaitForCommand(ctx context.Context, t *testing.T, command string, args []string, wants string, cleanupCommand string, cleanupArgs []string, timeout time.Duration, retryDelay time.Duration)

WaitForCommand executes the provided command until it succeeds with the expected output.

Types

type SlurmImageConfig

type SlurmImageConfig struct {
	Tag  string
	Repo string
}

type SlurmInstallationConfig

type SlurmInstallationConfig struct {
	Accounting bool
	DaemonSet  bool
	Login      bool
	Metrics    bool
	Namespace  string
	Pyxis      bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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