ocitest

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package ocitest provides test helpers for publishing Dev Container Features to an ephemeral, in-memory OCI registry, so tests across packages can exercise the Feature fetch and merge paths against real registry round-trips without a network dependency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeatureArchive

func FeatureArchive(t *testing.T, metadata string, compress bool) []byte

FeatureArchive builds an in-memory tar archive containing a devcontainer-feature.json with the given metadata, the layer payload of a published Feature. When compress is true the archive is gzip-compressed, exercising the fetcher's decompression path.

func PushFeature

func PushFeature(t *testing.T, host, repo, tag string, archive []byte, asIndex bool)

PushFeature publishes archive as a Feature artifact at host/repo:tag. See [pushArtifact] for the meaning of asIndex.

func PushImage

func PushImage(t *testing.T, host, repo, tag string, labels map[string]string, asIndex bool)

PushImage publishes a minimal container image at host/repo:tag whose config carries the given labels, for exercising the base-image metadata path. See [pushArtifact] for the meaning of asIndex.

func Registry

func Registry(t *testing.T) string

Registry starts an ephemeral, in-memory OCI registry on a loopback address and returns its host (host:port). Loopback hosts are reached over plain HTTP, which the Feature fetcher permits. The registry is shut down when the test ends.

Types

This section is empty.

Jump to

Keyboard shortcuts

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