utils

package
v0.0.0-...-530963e Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(c io.Closer)

Close closes the given Closer and fails if there is an error.

func CycleUntilComplete

func CycleUntilComplete[R CompletableJob](
	interval time.Duration,
	producer func() (R, error),
) (R, error)

CycleUntilComplete will invoke producer function every interval. Once the producer gives non-nil value the cycle will come to an end. Either due to concrete error or result value.

func DumpErrorsMap

func DumpErrorsMap(registry map[string]error, w io.Writer)

func DumpJSON

func DumpJSON(v any, w io.Writer)

DumpJSON dumps the given value as JSON to the given writer.

func Fail

func Fail(msg string, args ...any)

Fail logs the message and exits with code 1.

func MustCreateProvCredENV

func MustCreateProvCredENV(providerName string,
	withRequiredAccessToken bool,
	customFields ...credscanning.Field,
) *credscanning.ProviderCredentials

MustCreateProvCredENV can be used by tests supplying variables via environment.

func MustCreateProvCredJSON

func MustCreateProvCredJSON(filePath string,
	withRequiredAccessToken bool,
	customFields ...credscanning.Field,
) *credscanning.ProviderCredentials

func SetupLogging

func SetupLogging()

SetupLogging sets up logging for the test suite.

func Timestamp

func Timestamp(timeText string) time.Time

Types

type CompletableJob

type CompletableJob interface {
	IsStatusDone() bool
}

Directories

Path Synopsis
Package testroutines holds a collection of common test procedures.
Package testroutines holds a collection of common test procedures.

Jump to

Keyboard shortcuts

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