acceptance

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNoError

func AssertNoError(t *testing.T, err error, msgAndArgs ...any)

AssertNoError is a helper that fails the test if an error occurs and logs additional context in verbose mode

func AssertNotNil

func AssertNotNil(t *testing.T, object any, msgAndArgs ...any)

AssertNotNil is a helper that fails the test if the object is nil

func Cleanup

func Cleanup(t *testing.T, cleanupFunc func())

Cleanup registers a cleanup function that respects the SkipCleanup flag

func InitClient

func InitClient() error

InitClient initializes the shared Workbrew client Returns an error if the API key or workspace name is not set or client creation fails

func IsAPIKeySet

func IsAPIKeySet() bool

IsAPIKeySet returns true if the API key is configured

func IsConfigured

func IsConfigured() bool

IsConfigured returns true if both API key and workspace are configured

func IsWorkspaceSet

func IsWorkspaceSet() bool

IsWorkspaceSet returns true if the workspace name is configured

func LogGroup

func LogGroup(title string)

LogGroup starts a collapsible log group in GitHub Actions

func LogGroupEnd

func LogGroupEnd()

LogGroupEnd ends a collapsible log group in GitHub Actions

func LogResponse

func LogResponse(t *testing.T, message string, details ...any)

LogResponse logs the response details if verbose mode is enabled

func LogTestError

func LogTestError(t *testing.T, message string, details ...any)

LogTestError logs a test error (does not fail test)

func LogTestStage

func LogTestStage(t *testing.T, stage string, message string, details ...any)

LogTestStage logs a test stage with optional GitHub Actions notice annotation

func LogTestSuccess

func LogTestSuccess(t *testing.T, message string, details ...any)

LogTestSuccess logs a successful test operation

func LogTestWarning

func LogTestWarning(t *testing.T, message string, details ...any)

LogTestWarning logs a test warning

func NewContext

func NewContext() (context.Context, context.CancelFunc)

NewContext creates a context with timeout for acceptance tests

func RateLimitedTest

func RateLimitedTest(t *testing.T, testFunc func(t *testing.T))

RateLimitedTest wraps a test function with rate limiting Automatically sleeps after test execution to respect API rate limits

func RequireClient

func RequireClient(t *testing.T)

RequireClient ensures the shared client is initialized Skips the test if the API key or workspace is not set or client initialization fails

func SkipIfAPIKeyNotSet

func SkipIfAPIKeyNotSet(t *testing.T)

SkipIfAPIKeyNotSet skips the test if the API key is not configured

func SkipIfNotConfigured

func SkipIfNotConfigured(t *testing.T)

SkipIfNotConfigured skips the test if either API key or workspace is not configured

func SkipIfWorkspaceNotSet

func SkipIfWorkspaceNotSet(t *testing.T)

SkipIfWorkspaceNotSet skips the test if the workspace name is not configured

Types

type TestConfig

type TestConfig struct {
	APIKey                string
	WorkspaceName         string
	BaseURL               string
	RateLimitDelay        time.Duration
	RequestTimeout        time.Duration
	SkipCleanup           bool
	Verbose               bool
	KnownDeviceSerial     string
	KnownGroupName        string
	KnownBrewfileName     string
	KnownCaskName         string
	KnownFormulaName      string
	KnownEventID          string
	KnownVulnerabilityCVE string
}

TestConfig holds configuration for acceptance tests

var (
	// Config is the global test configuration
	Config *TestConfig
	// Client is the shared Workbrew client for acceptance tests
	Client *client.Transport
)

Jump to

Keyboard shortcuts

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