testutils

package
v0.0.0-...-32cd23d Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DB_WAL_PATH = data.DB_PATH + "-wal"
	DB_SHM_PATH = data.DB_PATH + "-shm"
)
View Source
const (
	MinioEndpoint        = "http://127.0.0.1:9000"
	MinioAccessKeyID     = "minioadmin"
	MinioSecretAccessKey = "minioadmin"
	MinioBucket          = "hishtory-test"
	MinioRegion          = "us-east-1"
)

MinIO test configuration

View Source
const DefaultGitBranchName = "master"

Variables

This section is empty.

Functions

func BackupAndRestore

func BackupAndRestore(t testing.TB) func()

func BackupAndRestoreEnv

func BackupAndRestoreEnv(k string) func()

func BackupAndRestoreWithId

func BackupAndRestoreWithId(t testing.TB, id string) func()

func CompareGoldens

func CompareGoldens(t testing.TB, out, goldenName string)

func CurrentShardNumber

func CurrentShardNumber() int

CurrentShardNumber returns the current shard number, or -1 if not sharding.

func GetCurrentGitBranch

func GetCurrentGitBranch(t *testing.T) string

func GetOsVersion

func GetOsVersion(t *testing.T) string

func IsGithubAction

func IsGithubAction() bool

func IsMinioRunning

func IsMinioRunning() bool

IsMinioRunning checks if the MinIO server is running and accessible

func IsOnline

func IsOnline() bool

func IsShardedTestRun

func IsShardedTestRun() bool

IsShardedTestRun returns whether this is a sharded test run (i.e., in GitHub Actions).

func MakeFakeHistoryEntry

func MakeFakeHistoryEntry(command string) data.HistoryEntry

func MarkTestForSharding

func MarkTestForSharding(t *testing.T, testShardNumber int)

MarkTestForSharding marks the given test for sharding with the given test ID number. Tests with the same shard number will run on the same shard.

func NumTestShards

func NumTestShards() int

NumTestShards returns the total number of test shards, or -1 if not sharding.

func ResetFakeHistoryTimestamp

func ResetFakeHistoryTimestamp()

func ResetLocalState

func ResetLocalState(t testing.TB)

func RunMinioServer

func RunMinioServer() func()

RunMinioServer starts a MinIO server for S3 backend testing. On macOS, it prefers using a native MinIO binary (installed via brew). On other platforms, it uses Docker to run MinIO. If neither is available, it prints a warning and returns a no-op cleanup function.

func RunTestServer

func RunTestServer() func()

func TestLog

func TestLog(t testing.TB, line string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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