utils

package
v0.0.0-...-5ea965e Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 7 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 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, withRequiredWorkspace bool,
) *credscanning.ProviderCredentials

MustCreateProvCredENV can be used by tests supplying variables via environment.

func MustCreateProvCredJSON

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

func SetupLogging

func SetupLogging()

SetupLogging sets up logging for the test suite.

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