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 ¶
const Alias = "registry"
Alias is the repository alias of the registry published to.
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 ¶
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 ¶
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 ¶
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.