testutil

package
v0.81.12 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 5 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

Overview

Package testutil holds test helpers shared across SpeechKit's kernel packages — temp-dir builders, fake clocks, identity injectors. Production code must not import this package; the build will fail at link time if it does.

Audit 2026-05-24 maintainability sweep.

Index

Constants

View Source
const (
	RequireConfigEnv   = "E2E_REQUIRE_CONFIG"
	RequireLiveTestEnv = "SPEECHKIT_REQUIRE_LIVE_TEST_CONFIG"
)

Environment variables that turn a missing external test configuration from a skip into a failure.

Variables

This section is empty.

Functions

func Eventually

func Eventually(t testing.TB, timeout, interval time.Duration, fn func() bool)

Eventually polls fn every interval until it returns true or timeout elapses, in which case the test fails.

func EventuallyNoError

func EventuallyNoError(t testing.TB, timeout, interval time.Duration, fn func() error)

EventuallyNoError polls fn until it returns nil or timeout elapses.

func ExplicitExternalTestConfigRequired

func ExplicitExternalTestConfigRequired() bool

ExplicitExternalTestConfigRequired is like ExternalTestConfigRequired but ignores the implicit CI signal.

func ExternalTestConfigRequired

func ExternalTestConfigRequired() bool

ExternalTestConfigRequired reports whether missing external test configuration must fail instead of skip (explicit opt-in or CI).

func RequireAnyEnvOrSkip

func RequireAnyEnvOrSkip(t testing.TB, envNames []string, guidance string) string

RequireAnyEnvOrSkip returns the first non-empty value among envNames, or skips (or fails) with guidance.

func RequireEnvOrSkip

func RequireEnvOrSkip(t testing.TB, envName, guidance string) string

RequireEnvOrSkip returns the trimmed value of envName, or skips (or fails, when configuration is required) with guidance.

func SkipOrFailExplicitMissingConfig

func SkipOrFailExplicitMissingConfig(t testing.TB, missing, guidance string)

SkipOrFailExplicitMissingConfig skips the test, or fails it only when configuration was explicitly required.

func SkipOrFailMissingConfig

func SkipOrFailMissingConfig(t testing.TB, missing, guidance string)

SkipOrFailMissingConfig skips the test, or fails it when external test configuration is required.

Types

This section is empty.

Jump to

Keyboard shortcuts

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