roundtriptest

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package roundtriptest publishes artifacts to an in-process OCI registry so that tests of the existing consumers (component source provisioning, scaffold generation, and vendoring) can prove a published package works through them. It composes the real artifact service and records every registry request, so a test can also prove which blobs a consumer actually fetched.

It is test support: it depends on the testing package and must not be imported by production code.

Index

Constants

View Source
const Alias = "registry"

Alias is the repository alias of the registry published to.

View Source
const Prefix = "acme/atmos"

Prefix is the repository path prefix below the registry host.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	// Host is the "127.0.0.1:PORT" registry address.
	Host string

	// Service is the real artifact service bound to the registry.
	Service artifact.Service
	// contains filtered or unexported fields
}

Registry is an in-process registry with a composed artifact service publishing to it.

func New

func New(t *testing.T, opts ...compose.Option) *Registry

New starts the registry and composes the artifact service with an oci/registry repository named Alias bound to it. Extra compose options apply after the defaults.

func (*Registry) Image

func (r *Registry) Image(name, version string) string

Image returns the OCI image reference (without a scheme) of a published name and version.

func (*Registry) Publish

func (r *Registry) Publish(t *testing.T, request *artifact.PublishRequest) *artifact.OperationResult

Publish publishes request to the registry. The repository is always Alias.

func (*Registry) Requests

func (r *Registry) Requests() []string

Requests returns the "METHOD path" of every request the registry served so far.

func (*Registry) ResetRequests

func (r *Registry) ResetRequests()

ResetRequests forgets the recorded requests, so a test can observe one consumer in isolation.

func (*Registry) URI

func (r *Registry) URI(name, version string) string

URI returns the oci:// source URI of a published name and version, as consumers declare it.

Jump to

Keyboard shortcuts

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