Documentation
¶
Overview ¶
Package extensionrepo runs repository tasks through the extension's export program. It owns checks, contract lookup, updates, staged install, and uninstall, as Extension repository in contract.md defines. Its test wrapper prints notices after Go's package results, as Test kit defines.
Index ¶
- Constants
- func Install(e extension.Extension, executable, dir string) error
- func Main(e extension.Extension)
- func Notice(message string) error
- func ScenarioRun(name string) string
- func Test(args []string) int
- func Uninstall(e extension.Extension, dir string) ([]string, error)
- type OwnedRun
- type Profile
- type SpecKind
- type SpecLine
Constants ¶
const ScenarioEnv = "NCLY_TEST_SCENARIO"
ScenarioEnv names the scenario that a run of go test runs alone, for just scenario and for the repeat of signoff. When -run is ScenarioRun of that name, the test kit skips its coverage checks, which need every scenario.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install stages executable and the embedded sidecars of e, then publishes the executable last. The kit uses it with its built executable and a scratch extensions folder.
func Main ¶
Main runs a repository task, then exits. The export subcommand writes embedded sidecars for the staged build.
func Notice ¶
Notice records a test notice for Test to print after the packages finish. Outside the owned run of Test, it writes to stdout, which go test can hide for passing packages.
func ScenarioRun ¶ added in v0.25.0
ScenarioRun is the -run pattern of go test that selects only the scenario testdata/script/<name>.txtar.
Types ¶
type OwnedRun ¶ added in v0.26.0
type OwnedRun struct {
// Dir is the folder of the run. A scratch run holds HOME, TMPDIR, and
// the XDG folders there. A host run keeps its notices there.
Dir string
// Env is the whole environment of each program that the run starts.
Env []string
}
OwnedRun is the environment and the scratch folder of one verification run, as Owned runs in the contract defines. The test kit, signoff, release, and acceptance each build theirs with NewOwnedRun. The analyzer callerenv refuses os.Environ elsewhere in this package and the kit.
func NewOwnedRun ¶ added in v0.26.0
NewOwnedRun builds the environment of a run in dir, which must be an absolute path, or empty for a host run without notices. It is the one function of the kit and the repository gates that reads the environment of the caller as a whole.
Each run masks GOFLAGS with a blank value, which also masks one that go env -w keeps, and sets GOWORK=off, unless Keep names them. A host run with a folder records the notices of its programs in that folder.
type Profile ¶ added in v0.26.0
type Profile struct {
// Scratch gives the run its own HOME, TMPDIR, and XDG folders in Dir,
// and no D-Bus session. It keeps no other variable of the caller.
// Without Scratch, the run keeps the tools and accounts of the caller,
// and drops the caller state of dropped.
Scratch bool
// Path holds the folders that go first in PATH, before those of the
// caller that hold no ncly-* file. Only a scratch run reads it.
Path []string
// Keep names the variables of the caller that the run keeps anyway,
// such as GIT_CONFIG_GLOBAL.
Keep []string
// Set gives variables their values in the run, after all others.
Set map[string]string
}
Profile says what an owned run keeps of its caller.
type SpecLine ¶ added in v0.25.0
type SpecLine struct {
Part string
Number int
Kind SpecKind
// Cells holds the cells of a header or a row, without spaces around them.
Cells []string
// ID holds the spec ID that starts a row or a bullet, or "".
ID string
// Rest holds the text after the bold label of a SpecLabel.
Rest string
}
A SpecLine is one line of spec.md, read as "Spec IDs" in the contract says. A part starts at a heading, or at a line that starts with a bold label, such as **Failures.**, and ends at the next one. The test kit reads the parts Failures and Acceptance, and finish reads Open lines and Limits.
func SpecLines ¶ added in v0.25.0
SpecLines reads each line of a spec.md. A row starts with its ID as its first cell. A bullet starts with its ID and a colon, such as - `duration`: the duration. So a bullet that only starts with code holds no ID. The header row of a table is the row above its separator.
Source Files
¶
- acceptance.go
- finish.go
- install.go
- intake.go
- ledger.go
- ledger_findings.go
- ledger_history.go
- ledger_run.go
- models.go
- owned_run.go
- program.go
- readiness.go
- readiness_verdict.go
- recipes.go
- records.go
- records_view.go
- release.go
- release_command.go
- release_economy.go
- release_example.go
- release_install.go
- release_receipt.go
- result.go
- rule_index.go
- scenario.go
- signoff.go
- signoff_receipt.go
- signoff_replay.go
- spec.go
- spec_matrix.go
- test.go
- update.go
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
extensionrepo
command
Command extensionrepo runs repository tasks through the shared SDK, including from a downloaded Nicely module.
|
Command extensionrepo runs repository tasks through the shared SDK, including from a downloaded Nicely module. |
|
Command test runs Go tests and prints their collected notices after the package results.
|
Command test runs Go tests and prints their collected notices after the package results. |