internal

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogWriter

func NewLogWriter(t testing.TB) io.Writer

NewLogWriter an io.Writer wrapper for pushing log writes to t.Log

Types

type Suite

type Suite struct {
	suite.Suite

	Logger     *logrus.Logger
	LoggerHook *test.Hook

	Metrics *prometheus.Metrics
}

Suite is an extension of github.com/stretchr/testify/suite.Suite

func (*Suite) AssertNoLogsWithLevelOrHigher

func (s *Suite) AssertNoLogsWithLevelOrHigher(lvl logrus.Level)

AssertNoLogsWithLevelOrHigher check that there are now log entries witch or of the given level or higher For example `AssertNoLogsWithLevelOrHigher(logrus.ErrorLevel)` will assert that no log entries with level error, fatal or panic where recorded.

func (*Suite) GetLogger

func (s *Suite) GetLogger() goengine.Logger

GetLogger return a log.Logger based o the suites logger

func (*Suite) Run

func (s *Suite) Run(name string, f func()) bool

Run runs f as a subtest of t called name.

func (*Suite) SetT

func (s *Suite) SetT(t *testing.T)

SetT sets the current *testing.T context

func (*Suite) SetupTest

func (s *Suite) SetupTest()

SetupTest set logrus output to use the current testing.T

func (*Suite) TearDownTest

func (s *Suite) TearDownTest()

TearDownTest cleanup suite variables

Jump to

Keyboard shortcuts

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