Documentation
¶
Index ¶
- func AssertNoError(t *testing.T, err error, msgAndArgs ...any)
- func AssertNotNil(t *testing.T, object any, msgAndArgs ...any)
- func Cleanup(t *testing.T, cleanupFunc func())
- func InitClient() error
- func IsAPIKeySet() bool
- func IsConfigured() bool
- func IsWorkspaceSet() bool
- func LogGroup(title string)
- func LogGroupEnd()
- func LogResponse(t *testing.T, message string, details ...any)
- func LogTestError(t *testing.T, message string, details ...any)
- func LogTestStage(t *testing.T, stage string, message string, details ...any)
- func LogTestSuccess(t *testing.T, message string, details ...any)
- func LogTestWarning(t *testing.T, message string, details ...any)
- func NewContext() (context.Context, context.CancelFunc)
- func RateLimitedTest(t *testing.T, testFunc func(t *testing.T))
- func RequireClient(t *testing.T)
- func SkipIfAPIKeyNotSet(t *testing.T)
- func SkipIfNotConfigured(t *testing.T)
- func SkipIfWorkspaceNotSet(t *testing.T)
- type TestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNoError ¶
AssertNoError is a helper that fails the test if an error occurs and logs additional context in verbose mode
func AssertNotNil ¶
AssertNotNil is a helper that fails the test if the object is nil
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 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 LogResponse ¶
LogResponse logs the response details if verbose mode is enabled
func LogTestError ¶
LogTestError logs a test error (does not fail test)
func LogTestStage ¶
LogTestStage logs a test stage with optional GitHub Actions notice annotation
func LogTestSuccess ¶
LogTestSuccess logs a successful test operation
func LogTestWarning ¶
LogTestWarning logs a test warning
func NewContext ¶
func NewContext() (context.Context, context.CancelFunc)
NewContext creates a context with timeout for acceptance tests
func RateLimitedTest ¶
RateLimitedTest wraps a test function with rate limiting Automatically sleeps after test execution to respect API rate limits
func RequireClient ¶
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 ¶
SkipIfAPIKeyNotSet skips the test if the API key is not configured
func SkipIfNotConfigured ¶
SkipIfNotConfigured skips the test if either API key or workspace is not configured
func SkipIfWorkspaceNotSet ¶
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 )