Help us shape the future of Go! Take the 2026 Go Developer Survey

enginetest

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

Package enginetest contains shared, provider-neutral reconciliation assertions.

SPDX-License-Identifier: Apache-2.0 Copyright 2026 The Karakoram Authors

Index

Constants

View Source
const Alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
View Source
const IdleCycles = 20

IdleCycles deliberately reloads pointers on every reconciliation, rather than comparing an in-memory checkpoint with the object that originally created it.

Variables

View Source
var AgentCredential = CredentialLimit{51, 51, Alphanumeric + "_", "kk_"}

AgentCredential is Karakoram's bearer format, not a native engine password.

Functions

func AssertIdle

func AssertIdle(t *testing.T, p engine.Provider, rc *engine.Context, apply func())

AssertIdle drives ordinary Sync plus the shared availability observation to Ready, persists through the real SQL store and JSON decoder after EVERY cycle, then requires twenty further Ready cycles without an infrastructure mutation. Applied generation is checked separately: a healthy but unconverged fixture cannot accidentally pass. Positive provider samples must satisfy the same freshness contract as production, not just return Ready from raw Status. apply models agent configuration acceptance, not provider reconciliation.

func SupabaseCredentialContracts added in v0.4.2

func SupabaseCredentialContracts(t *testing.T, keys sbkeys.Keys)

SupabaseCredentialContracts checks every persisted field, not a password proxy. Formats: https://supabase.com/docs/guides/self-hosting/self-hosted-auth-keys Component key sizes: https://supabase.com/docs/guides/self-hosting/docker P-256 JWK coordinates/scalars: RFC 7518 section 6.2 (32 octets, base64url).

Types

type CredentialLimit added in v0.4.2

type CredentialLimit struct {
	Min, Max         int
	Alphabet, Prefix string
}

CredentialLimit describes an output contract. Max == 0 means no documented native maximum, not a claim that every possible input is accepted.

func (CredentialLimit) Assert added in v0.4.2

func (l CredentialLimit) Assert(t *testing.T, name, value string)

type CredentialStore added in v0.4.2

type CredentialStore struct {
	engine.SecretStore
	Values map[string][]byte
	Tokens map[string]string
}

CredentialStore observes real provider writes while retaining the fixture's persistence behavior. TLS material is transport identity, not a password. Native OpenBao /sys/init root tokens/shares and Elasticsearch service-account tokens/API keys are engine-generated opaque outputs: no bounds are invented.

func RecordCredentials added in v0.4.2

func RecordCredentials(rc *engine.Context) *CredentialStore

func (*CredentialStore) Assert added in v0.4.2

func (s *CredentialStore) Assert(t *testing.T, limits map[string]CredentialLimit, usernameMax int)

Assert also requires and checks credentials persisted in the agent-token store.

func (*CredentialStore) AssertValues added in v0.4.2

func (s *CredentialStore) AssertValues(t *testing.T, limits map[string]CredentialLimit, usernameMax int)

AssertValues rejects every unlisted persisted credential, including future keys. Every declared key must be written, preventing vacuous seeding tests.

func (*CredentialStore) SetAgentToken added in v0.4.2

func (s *CredentialStore) SetAgentToken(ctx context.Context, token *domain.AgentToken) error

func (*CredentialStore) SetClusterSecret added in v0.4.2

func (s *CredentialStore) SetClusterSecret(ctx context.Context, ref domain.ClusterRef, key string, value []byte) error

type RecordingBackend

type RecordingBackend struct {
	infra.Backend
	// contains filtered or unexported fields
}

RecordingBackend preserves a fixture's observations and mutation semantics, while exposing the real Zerops layout/capabilities and recording ALL mutation submissions, including redundant requests and requests that fail.

func (*RecordingBackend) Calls

func (b *RecordingBackend) Calls() []string

func (*RecordingBackend) Capabilities

func (*RecordingBackend) Capabilities() infra.Capabilities

func (*RecordingBackend) DeletePublicPorts

func (b *RecordingBackend) DeletePublicPorts(ctx context.Context, name string) error

func (*RecordingBackend) DeleteService

func (b *RecordingBackend) DeleteService(ctx context.Context, name string) (infra.Op, error)

func (*RecordingBackend) DeleteServiceByID

func (b *RecordingBackend) DeleteServiceByID(ctx context.Context, name, id string) (infra.Op, error)

func (*RecordingBackend) Deploy

func (b *RecordingBackend) Deploy(ctx context.Context, name string, d infra.Deployment) (infra.Op, error)

func (*RecordingBackend) EnsurePublicPort

func (b *RecordingBackend) EnsurePublicPort(ctx context.Context, name string, port infra.PublicPort) error

func (*RecordingBackend) ImportServices

func (b *RecordingBackend) ImportServices(ctx context.Context, specs []infra.ServiceSpec) (infra.Op, error)

func (*RecordingBackend) Layout

func (*RecordingBackend) Layout() infra.Layout

func (*RecordingBackend) Name

func (*RecordingBackend) Name() string

func (*RecordingBackend) Restart

func (b *RecordingBackend) Restart(ctx context.Context, name string) (infra.Op, error)

func (*RecordingBackend) SetContainerCount

func (b *RecordingBackend) SetContainerCount(ctx context.Context, name string, min, max int) (infra.Op, error)

func (*RecordingBackend) SetEnvSecrets

func (b *RecordingBackend) SetEnvSecrets(ctx context.Context, name string, env map[string]string) error

func (*RecordingBackend) SetEnvVars

func (b *RecordingBackend) SetEnvVars(ctx context.Context, name string, env map[string]string) error

func (*RecordingBackend) SetResources

func (b *RecordingBackend) SetResources(ctx context.Context, name string, r infra.Resources) (infra.Op, error)

func (*RecordingBackend) SetSubdomainAccess

func (b *RecordingBackend) SetSubdomainAccess(ctx context.Context, name string, enabled bool) (infra.Op, error)

func (*RecordingBackend) Start

func (b *RecordingBackend) Start(ctx context.Context, name string) (infra.Op, error)

func (*RecordingBackend) Stop

func (b *RecordingBackend) Stop(ctx context.Context, name string) (infra.Op, error)

func (*RecordingBackend) SubdomainURLs

func (b *RecordingBackend) SubdomainURLs(ctx context.Context, name string) ([]string, error)

Jump to

Keyboard shortcuts

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