Documentation ¶
Overview ¶
Package test implements universal helpers for unit and integration tests
Index ¶
- Constants
- func BackendTest(u *url.URL, n int)
- func BeRandom() types.GomegaMatcher
- func Entropy(data []byte) float64
- func GenerateKeyPairs() (*crypto.KeyPair, *crypto.KeyPair, error)
- func GenerateSignalingMessage() *signaling.Message
- func HaveEntropy(minEntropy float64) types.GomegaMatcher
- func IsCI() bool
- func ParallelNew[T any](cnt int, ctor func(i int) (T, error)) ([]T, error)
- func ReceiveEvent[E any](e *E) types.GomegaMatcher
- func SetupLogging() *log.Logger
- func SetupLoggingWithFile(fn string, truncate bool) (*log.Logger, error)
- func WithProgress(ctx context.Context, run func(started, completed chan string) error, ...) error
- type DefaultProgressHandler
- type ProgressHandler
Constants ¶
View Source
const IsRace = false
Variables ¶
This section is empty.
Functions ¶
func BackendTest ¶
TestBackend creates n peers with separate connections to the signaling backend u and exchanges a test message between each pair of backends
func BeRandom ¶
func BeRandom() types.GomegaMatcher
func HaveEntropy ¶
func HaveEntropy(minEntropy float64) types.GomegaMatcher
func ReceiveEvent ¶
func ReceiveEvent[E any](e *E) types.GomegaMatcher
func SetupLogging ¶
func SetupLoggingWithFile ¶
func WithProgress ¶
Types ¶
type DefaultProgressHandler ¶
func (*DefaultProgressHandler) OnEnd ¶
func (ph *DefaultProgressHandler) OnEnd(cntCompleted, cntFailed uint, durElapsed time.Duration)
func (*DefaultProgressHandler) OnError ¶
func (ph *DefaultProgressHandler) OnError(err error)
func (*DefaultProgressHandler) OnProgress ¶
func (ph *DefaultProgressHandler) OnProgress(cntStarted, cntCompleted, cntFailed uint, durElapsed, durRemaining time.Duration, idsMissing []string)
func (*DefaultProgressHandler) OnStart ¶
func (ph *DefaultProgressHandler) OnStart()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.