# Packages
Package assertions contains all the assertions that can be used in tests for cluster testing.
No description provided by the author
No description provided by the author
No description provided by the author
Package mock contains useful functionality for testing.
No description provided by the author
# Functions
AddReportEntriesAsYaml adds multiple report entries formatted as YAML to the current SpecReport.
AddReportEntryAsYaml marshals the given object as YAML and adds it to the test report with the given name.
BuildCondition starts a condition builder object useful for unit tests that require validating multiple conditions.
Case the unique case name label.
ConditionIsReady returns an error if the condition status is not True useful for Eventually checks.
ConvertTypeMetaToGroupVersionResource converts type meta to group version resource.
DefaultConvertRuntimeToClientobjectFunc convert runtime.Object to client.Object be similar to convertFromUnstructuredIfNecessary.
DeleteResources delete resources contained in the file.
DiffEqualTo will use github.com/google/go-cmp/cmp.Diff to compare you can use diffCleanFuncs to change object in order to clean some fields that you don't want to compare Deprecated: use assertions.DiffEqual instead.
ExecBashScript exec bash script with params Deprecated: move to testing/script ExecBashScript.
ExecScript exec script with params Deprecated: move to testing/script ExecScript.
ExpectDiff will using github.com/google/go-cmp/cmp.Diff to compare two data as default, it will not compare fields that have some undetermined value like uid, timestamp when compare kubernetes object you can use diffCleanFuncs to change object in order to clean some fields that you don't want to compare eg: clean status when compare
ExpectDiff(actual, expected, KubeObjectDiffClean, func(object ctrlclient.Object) { object.(*corev1.Pod).Status = corev1.PodStatus{} // do not compare Status return object }).Should(BeEmpty())
Deprecated: should use regular Expect with assertions.DiffEqual instead Example:
Expect(obj).To(DiffEqual(expected, cmpopts.IgnoreTypes(v1.TypeMeta{}, v1.PodStatus{}))).
GetCaseNames Resolve the case identifier from the testcase name in the junit report For go test junit report, the case name may be started with `Test`, e.g: TestGetProject For ginkgo test junit report, the case name may contain the {case:%s} string, e.g: [It] when xxxx [{case:GetProject}].
GetDefaultEnv get the parameter from env, if not set it use the defaultValue instead.
GetDefaultLogger returns the default logger for testing.
InitGinkgoWithLogger initializes Ginkgo and returns a logger.
InitializeGinkgoConfig initializes the Ginkgo configuration.
KubeObjectDiffClean will clean these fields in order to clean when diff kubernetes objects - CreationTimestamp - ManagedFields - UID - ResourceVersion - Generation - SelfLink
Deprecated: use assertions.DiffEqual and assertions.IgnoreObjectMetaFields instead.
ListByGVK creates a new UnstructuredList initialized with the given GroupVersionKind.
LoadJSON loads json.
LoadKubeResources loading kubernetes resources.
No description provided by the author
LoadMultiYamlOrJson loads multi yamls.
LoadObjectOrDie loads object from yaml and returns.
LoadObjectReferenceOrDie loads object reference from yaml and returns.
No description provided by the author
No description provided by the author
LoadYAML loads yaml.
MustLoadFileBytes loads a file as []bytes will panic if if failes ONLY FOR TEST USAGE.
MustLoadFileString loads a file as string will panic if if failes ONLY FOR TEST USAGE.
MustLoadJSON loads json or panics if the parse fails.
MustLoadMultiYamlOrJson loads multi yamls or panics if the parse fails.
MustLoadReturnObjectFromYAML loads and object from yaml file and returns as interface{} if any loading errors happen will panic TO BE USED IN TESTS, DO NOT USE IN PRODUCTION CODE.
MustLoadYaml loads yaml or panics if the parse fails.
NewGinkgoLogger creates a new logger for Ginkgo tests.
ReflectName reflect the type name of the object.
RestoreDirectories restore directories from embed.FS to targetDir Deprecated: move to testing/script RestoreDirectories.
RuntimeObjectFromUnstructured converts an unstructured to a runtime object.
No description provided by the author
SliceToInterfaceSlice convert a slice to a slice of interface.
SliceToRuntimeOjbect convert slice to runtime.Object.
ToObjectList converts resource list to a list of client.Object.
UnstructedToTyped converts an unstructured object into a object Warning: This SHOULD never be used in production code, only in test code.
WarningOnError set a warning on error.
# Constants
DefaultScriptOutputPrefix the prefix of script output Deprecated: move to testing/script DefaultScriptOutputPrefix.
# Variables
IgnoreVolatileTime is a cmp option to ignore VolatileTime.
# Structs
ConditionBuilder builds a conditions in a builder pattern.
ScriptResult the result of script execution Deprecated: move to testing/script ScriptResult.
# Type aliases
No description provided by the author