testutils

package
v0.5.0-RC18 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error, expected bool, msg string) error

CheckError checks the given error taking into account if it was expected and potentially the message it should carry.

func CreateTestFiles

func CreateTestFiles(appFs afero.Fs, files map[string]string) error

CreateTestFiles creates the files in the map (path -> content) using the given afero file system.

func GetEnv

func GetEnv(key string, defaultValue string) string

GetEnv reads an environment variable, returning a given default value if not present.

func ParseMetricFamilies

func ParseMetricFamilies(content io.Reader) (map[string]*ioprometheusclient.MetricFamily, error)

ParseMetricFamilies parsing prometheus response from http endpoint

func ReadBytecode

func ReadBytecode(contractPath string) (string, error)

ReadBytecode reads the bytecode of the given contract.

func WaitUntil

func WaitUntil(t *testing.T, wg *sync.WaitGroup, timeout time.Duration)

WaitUntil waits for the given WaitGroup to end. The test fails if the WaitGroup is not finished before the provided timeout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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