testutil

package
v0.75.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package testutil provides global testing helper functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChecksumZarfYAMLContent added in v0.75.1

func ChecksumZarfYAMLContent(t *testing.T, pkg v1alpha1.ZarfPackage) string

ChecksumZarfYAMLContent returns sha256(marshal(pkg)) with pkg.Build zeroed. Build carries intrinsically non-reproducible values (timestamp, user, hostname, CLI version) so it is excluded; the result pins everything else and must be stable across build hosts.

func RequireNoBackslashInPackagePaths added in v0.75.1

func RequireNoBackslashInPackagePaths(t *testing.T, pkg v1alpha1.ZarfPackage)

RequireNoBackslashInPackagePaths asserts every path field serialized into a built zarf.yaml uses forward-slash separators, so artifacts are byte-identical across build hosts.

func SetupInMemoryRegistry added in v0.38.2

func SetupInMemoryRegistry(ctx context.Context, t *testing.T, port int) string

SetupInMemoryRegistry sets up an in-memory registry on localhost and returns the address.

func TestContext

func TestContext(t *testing.T) context.Context

TestContext takes a testing.T and returns a context that is attached to the test by t.Cleanup()

Types

This section is empty.

Jump to

Keyboard shortcuts

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