Documentation
¶
Overview ¶
Package formattest is the contract suite for package formats (decision 0032). Every format runs Run with a fixture that builds packages of its type, and one set of scenarios proves, on the in-memory, SQLite and PostgreSQL stores, that its package index (decision 0018) stays right on every write path the item service offers: deploy, overwrite, delete, copy, move, restore from the trash can, property changes and a remote repository's cache.
"Right" has two halves. The fixture says which versions a scenario leaves and which files each links. And the item tree is the source of truth, so the index the hooks kept must be the one the format's reindex reads from the tree: a reindex over it changes nothing, and a reindex from an empty index rebuilds it. A format that indexes nothing must leave the index empty.
The suite drives the item service, whose entry points every API calls: the properties API and AQL properties.update call Service.Annotate, which internal/server's TestPropertyWritesReachTheFormat holds them to.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Format ¶
type Format struct {
// Type is the package type of the repositories the suite creates.
Type repo.PackageType
// Layout, when set, is the repositories' repoLayoutRef.
Layout string
// Handler is the format; nil means the one formats.For picks for Type.
Handler format.Handler
// Version returns version v of package p as deployed for the nth time.
// The suite names packages "alpha" and "beta" and versions "1.0" and
// "2.0"; the fixture maps them to its ecosystem's names. Every n gives
// the same paths, and n > 0 changes the content of at least one file,
// so a redeploy overwrites.
Version func(p, v string, n int) Version
// Properties are the property sets the suite applies in turn to a
// version's files: a format whose index follows properties names the
// ones it reads. Nil means a set the format does not read.
Properties []types.Properties
// Work lists the kinds of work the format queues on a deploy. Each
// committed deploy leaves exactly one item of each per package; a kind
// not listed must never be queued.
Work []string
// NoRemoteCache marks a format that does not index a remote
// repository's cache yet, as decision 0018 has the npm, Go and Maven
// formats do. Docker sets it until its remote repositories come in P9.
NoRemoteCache bool
}
Format is a format under the contract.
type Version ¶
type Version struct {
// Package and Version are what the index calls it; both are empty for
// a format that keeps no index.
Package, Version string
// Files are deployed in order.
Files []File
// Linked are the paths of the files the index links to the version;
// nil means every file.
Linked []string
}
Version is one version of a package as a client deploys it.