testutil

package
v0.36.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 3 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

Index

Constants

View Source
const (
	Git        = "git"
	GitCliff   = "git-cliff"
	GH         = "gh"
	GLab       = "glab"
	Cog        = "cog"
	Communique = "communique"
)

Binary name constants used in contract tests.

Variables

This section is empty.

Functions

func RealGitRepo added in v0.25.0

func RealGitRepo(t *testing.T, tag string)

RealGitRepo creates a temporary git repository with a single tagged conventional commit and chdirs into it (restored on test cleanup). It is for the real-CLI smoke tests (T77) that run the actual git-cliff / cog against heraut's embedded default configs — the one place the suite uses real external binaries rather than MockRunner/FakeBin, because that is the only way to catch an embedded config the real tool rejects. Skips the test when git is not on PATH.

Types

type MockGenerator added in v0.3.0

type MockGenerator struct {
	CheckErr         error
	ValidateErr      error
	GenerateOut      string
	GenerateErr      error
	GenerateCalls    []string            // tags passed to Generate
	GenerateContexts []*port.LinkContext // link context passed alongside each tag (nil = single-platform)
	DegradedVal      bool                // value returned by Degraded()
}

MockGenerator is a port.Generator that records calls for contract testing.

func (*MockGenerator) Check added in v0.3.0

func (m *MockGenerator) Check() error

func (*MockGenerator) Degraded added in v0.26.0

func (m *MockGenerator) Degraded() bool

Degraded reports whether the generator fell back to offline mode (T78). It mirrors the optional Degraded() method the pipeline type-asserts on real generators.

func (*MockGenerator) Generate added in v0.3.0

func (m *MockGenerator) Generate(tag string, lc *port.LinkContext) (string, error)

func (*MockGenerator) Validate added in v0.3.0

func (m *MockGenerator) Validate() error

type MockPlatform added in v0.3.0

type MockPlatform struct {
	PlatformName     string
	CheckErr         error
	CreateReleaseErr error
	HasAssetsVal     bool
	UploadAssetsErr  error
	LinkContextVal   port.LinkContext

	CreateReleaseCalls []struct{ Tag, Notes string }
	UploadAssetsCalls  []string
}

MockPlatform is a port.Platform that records calls for contract testing.

func (*MockPlatform) Check added in v0.3.0

func (m *MockPlatform) Check() error

func (*MockPlatform) CreateRelease added in v0.3.0

func (m *MockPlatform) CreateRelease(tag, notes string) error

func (*MockPlatform) HasAssets added in v0.3.0

func (m *MockPlatform) HasAssets() bool

func (*MockPlatform) LinkContext added in v0.24.0

func (m *MockPlatform) LinkContext() port.LinkContext

func (*MockPlatform) Name added in v0.3.0

func (m *MockPlatform) Name() string

func (*MockPlatform) ReleaseURL added in v0.3.0

func (m *MockPlatform) ReleaseURL(tag string) string

func (*MockPlatform) UploadAssets added in v0.3.0

func (m *MockPlatform) UploadAssets(tag string) error

Jump to

Keyboard shortcuts

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