Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureStderr ¶ added in v0.50.2
CaptureStderr runs fn and returns everything written to os.Stderr during its execution. It restores os.Stderr automatically via t.Cleanup.
func GetTestRunDir ¶
func GetTestRunDir() string
GetTestRunDir returns the unique directory for this test run. It creates a directory in the system temp directory with a unique subdirectory based on the current timestamp and process ID. This ensures test directories are completely isolated from any git repository.
func RequireGhAwBinary ¶ added in v0.89.19
RequireGhAwBinary locates the built gh-aw binary used by integration tests and skips the calling test if it cannot be found.
The binary is resolved relative to the repository root, which is located by walking up from the current working directory in search of go.mod. This avoids the brittleness of hardcoding a relative path (such as "../../gh-aw"), which breaks if a test file moves to a different package depth, and honors runtime.GOOS to append ".exe" on Windows.
Returns the absolute path to the binary. If the repository root cannot be located or the binary does not exist, the test is skipped with a message instructing the caller to run `make build` first.
func StripYAMLCommentHeader ¶
StripYAMLCommentHeader removes the comment header from generated YAML files and returns only the non-comment YAML content. This is useful for tests that need to verify content without matching strings in the comment header.
func TempDir ¶
TempDir creates a temporary directory for testing within the test run directory. It automatically cleans up the directory when the test completes. This replaces the use of os.MkdirTemp or t.TempDir() to ensure all test artifacts are isolated in a known location outside any git repository.
Types ¶
This section is empty.