upstreamtest

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package upstreamtest gives tests the upstream transport's pool and credential resolver without importing the transport: core remote's and Smart Remote's tests may not import their own module's adapters (decision 0044, dependency rule 8), but test files may import any test support package (rule 1).

Role

artifacts module, test support for the upstream adapter (artifacts/adapters/upstream). Only test files import it.

Inputs

  • testing.TB, whose cleanup closes a pool and whose Fatal reports a resolver that cannot be built.
  • A store and a revision key, for NewResolver.

Outputs

  • NewPool: an empty *upstream.Pool, closed when the test ends, which a test holds as core remote's Upstream.
  • NewResolver: an *upstream.Resolver over the store with no keyring, whose Options method a test installs as Policy.Options.

References

Status

Implemented P9 (the pool and resolver it builds). Moved here in P9d.

Testing

Its callers, the core remote and Smart Remote tests, exercise it; it has no tests of its own and is excluded from the coverage gate, since its only other branch is the Fatal of an invalid revision key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPool

func NewPool(t testing.TB) *upstream.Pool

NewPool returns an empty transport pool that is closed when t ends.

func NewResolver

func NewResolver(t testing.TB, st upstream.ResolverStore, revisionKey []byte) *upstream.Resolver

NewResolver returns a credential resolver over st with no keyring and the given revision key (at least 32 bytes); it fails t when the options are invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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