Documentation
¶
Overview ¶
Package testutil provides testing utilities shared across packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LocalRegistry ¶
type LocalRegistry struct {
// contains filtered or unexported fields
}
LocalRegistry is a local OCI registry for testing.
func NewAuthenticatedLocalRegistry ¶ added in v1.4.0
func NewAuthenticatedLocalRegistry(t *testing.T, username, password string) *LocalRegistry
NewAuthenticatedLocalRegistry creates a local OCI registry protected by Basic Auth.
func NewLocalRegistry ¶
func NewLocalRegistry(t *testing.T) *LocalRegistry
NewLocalRegistry creates a new local OCI registry for testing.
func (*LocalRegistry) AddImage ¶
func (r *LocalRegistry) AddImage(t *testing.T, tarPath, name, version string) string
AddImage loads an image from a tar file and pushes it to the test registry. Returns the full image reference (e.g., "127.0.0.1:12345/name:version").
func (*LocalRegistry) GetRoundTripper ¶
func (r *LocalRegistry) GetRoundTripper(t *testing.T) http.RoundTripper
GetRoundTripper returns the HTTP transport for the test registry. Use this to configure a Downloader to use the test registry.
type TempScratchDirectory ¶
type TempScratchDirectory struct {
// contains filtered or unexported fields
}
TempScratchDirectory is a temporary directory for tests.
func NewTempScratchDirectory ¶
func NewTempScratchDirectory(t *testing.T) *TempScratchDirectory
NewTempScratchDirectory creates a new temporary directory for testing.
func (*TempScratchDirectory) Cleanup ¶
func (tsd *TempScratchDirectory) Cleanup(t *testing.T)
Cleanup removes the temporary directory.