testutil

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, MIT Imports: 14 Imported by: 2

Documentation

Overview

Package testutil contains testing helpers (logging, slow skipping).

Index

Constants

View Source
const (
	DummyPushServerAddr = "server.test"
	PushMockBundleID    = "tech.berty.mock"
)

Variables

This section is empty.

Functions

func Close

func Close(t *testing.T, closer io.Closer)

func FilterRace

func FilterRace(t *testing.T, race RacePolicy)

func FilterSpeed

func FilterSpeed(t *testing.T, speed Speed)

func FilterStability

func FilterStability(t *testing.T, stability Stability)

func FilterStabilityAndSpeed

func FilterStabilityAndSpeed(t *testing.T, stability Stability, speed Speed)

func LogTree

func LogTree(t *testing.T, log string, indent int, title bool, args ...interface{})

func Logger

func Logger(t testing.TB) (*zap.Logger, func())

func LoggerWithRing

func LoggerWithRing(t testing.TB) (*zap.Logger, *zapring.Core, func())

func TestFilterAppMetadata

func TestFilterAppMetadata(t *testing.T, events <-chan *protocoltypes.GroupMetadataEvent) []*protocoltypes.AppMetadata

Types

type PushMockedDispatcher

type PushMockedDispatcher struct {
	// contains filtered or unexported fields
}

func NewPushMockedDispatcher

func NewPushMockedDispatcher(bundleID string) *PushMockedDispatcher

func (*PushMockedDispatcher) BundleID

func (d *PushMockedDispatcher) BundleID() string

func (*PushMockedDispatcher) Debug

func (d *PushMockedDispatcher) Debug() string

func (*PushMockedDispatcher) Dispatch

func (d *PushMockedDispatcher) Dispatch(data []byte, receiver *protocoltypes.PushServiceReceiver) error

func (*PushMockedDispatcher) Len

func (d *PushMockedDispatcher) Len(token []byte) int

func (*PushMockedDispatcher) Shift

func (d *PushMockedDispatcher) Shift(token []byte) []byte

func (*PushMockedDispatcher) TokenType

type RacePolicy

type RacePolicy string

RacePolicy enum

const (
	SkipIfRace RacePolicy = "skip-if-race"
	RunIfRace  RacePolicy = "run-if-race"
)

type Speed

type Speed string

Speed level enum

const (
	Fast     Speed = "fast"
	Slow     Speed = "slow"
	AnySpeed Speed = "any"
)

type Stability

type Stability string

Stability level enum

const (
	Stable       Stability = "stable"
	Flappy       Stability = "flappy"
	Broken       Stability = "broken"
	AnyStability Stability = "any"
)

Jump to

Keyboard shortcuts

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