Documentation
¶
Overview ¶
Sorry, workaround to import cycles.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
func NewTestContext ¶
func NewTestContext(t testing.TB, buildVersion string, confString string) (context.Context, *state.Global)
NewTestContext builds a Global/context for tests. The config always starts from the repo's defaultConfig.hcl (schema-complete by construction — it's generated from the same Config struct these tests decode into), then layers confString on top if given. confString only needs to contain the blocks a particular test cares about (e.g. `inventory { stock "x" {...} }`) — it does not need to be a complete, standalone config.
func WithConfig ¶ added in v0.260830.0
WithConfig is a thin passthrough kept for existing call sites written before NewTestContext started loading defaultConfig.hcl as its base. extra no longer needs to be a complete, schema-valid HCL document — just the blocks a test wants to add or override — but code that already builds a bigger string (e.g. a locally-defined "minimal config" constant) still works fine passed through here, since decodeBody's per-fragment merge doesn't care how much or how little each fragment declares.
Types ¶
This section is empty.