package xtest
import "github.com/ydb-platform/ydb-go-sdk/v3/internal/xtest"
Index ¶
- func AllowByFlag(t testing.TB, flag string)
- func Context(t testing.TB) context.Context
- func SpinWaitCondition(tb testing.TB, l sync.Locker, cond func() bool)
- func SpinWaitConditionWithTimeout(tb testing.TB, l sync.Locker, condWaitTimeout time.Duration, cond func() bool)
- func TestManyTimes(t testing.TB, test TestFunc, opts ...TestManyTimesOption)
- func TestManyTimesWithName(t *testing.T, name string, test TestFunc)
- func WaitChannelClosed(t testing.TB, ch <-chan struct{})
- func WaitChannelClosedWithTimeout(t testing.TB, ch <-chan struct{}, timeout time.Duration)
- func WaitGroup(tb testing.TB, wg *sync.WaitGroup)
- func WaitGroupWithTimeout(tb testing.TB, wg *sync.WaitGroup, timeout time.Duration)
- type GrpcLogger
- func NewGrpcLogger(t testing.TB) GrpcLogger
- func (l GrpcLogger) StreamClientInterceptor( ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption, ) (grpc.ClientStream, error)
- func (l GrpcLogger) UnaryClientInterceptor( ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption, ) error
- type SyncedTest
- func MakeSyncedTest(t testing.TB) *SyncedTest
- func (s *SyncedTest) Cleanup(f func())
- func (s *SyncedTest) Error(args ...interface{})
- func (s *SyncedTest) Errorf(format string, args ...interface{})
- func (s *SyncedTest) Fail()
- func (s *SyncedTest) FailNow()
- func (s *SyncedTest) Failed() bool
- func (s *SyncedTest) Fatal(args ...interface{})
- func (s *SyncedTest) Fatalf(format string, args ...interface{})
- func (s *SyncedTest) Log(args ...interface{})
- func (s *SyncedTest) Logf(format string, args ...interface{})
- func (s *SyncedTest) Name() string
- func (s *SyncedTest) Setenv(key, value string)
- func (s *SyncedTest) Skip(args ...interface{})
- func (s *SyncedTest) SkipNow()
- func (s *SyncedTest) Skipf(format string, args ...interface{})
- func (s *SyncedTest) Skipped() bool
- func (s *SyncedTest) TempDir() string
- type TestFunc
- type TestManyTimesOption
- type TestWriter
Functions ¶
func AllowByFlag ¶
func Context ¶
func SpinWaitCondition ¶
SpinWaitCondition wait while cond return true with check it in loop l can be nil - then locker use for check conditions
func SpinWaitConditionWithTimeout ¶
func SpinWaitConditionWithTimeout(tb testing.TB, l sync.Locker, condWaitTimeout time.Duration, cond func() bool)
SpinWaitConditionWithTimeout wait while cond return true with check it in loop l can be nil - then locker use for check conditions
func TestManyTimes ¶
func TestManyTimes(t testing.TB, test TestFunc, opts ...TestManyTimesOption)
func TestManyTimesWithName ¶
func WaitChannelClosed ¶
func WaitChannelClosedWithTimeout ¶
func WaitGroup ¶
func WaitGroupWithTimeout ¶
Types ¶
type GrpcLogger ¶
type GrpcLogger struct {
// contains filtered or unexported fields
}
GrpcLogger use for log raw grpc messages
Usage:
db, err := ydb.Open(context.Background(), connectionString, ... ydb.With(config.WithGrpcOptions(grpc.WithChainUnaryInterceptor(xtest.NewGrpcLogger(t).UnaryClientInterceptor))), )
func NewGrpcLogger ¶
func NewGrpcLogger(t testing.TB) GrpcLogger
func (GrpcLogger) StreamClientInterceptor ¶
func (l GrpcLogger) StreamClientInterceptor( ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption, ) (grpc.ClientStream, error)
func (GrpcLogger) UnaryClientInterceptor ¶
func (l GrpcLogger) UnaryClientInterceptor( ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption, ) error
type SyncedTest ¶
func MakeSyncedTest ¶
func MakeSyncedTest(t testing.TB) *SyncedTest
func (*SyncedTest) Cleanup ¶
func (s *SyncedTest) Cleanup(f func())
func (*SyncedTest) Error ¶
func (s *SyncedTest) Error(args ...interface{})
func (*SyncedTest) Errorf ¶
func (s *SyncedTest) Errorf(format string, args ...interface{})
func (*SyncedTest) Fail ¶
func (s *SyncedTest) Fail()
func (*SyncedTest) FailNow ¶
func (s *SyncedTest) FailNow()
func (*SyncedTest) Failed ¶
func (s *SyncedTest) Failed() bool
func (*SyncedTest) Fatal ¶
func (s *SyncedTest) Fatal(args ...interface{})
func (*SyncedTest) Fatalf ¶
func (s *SyncedTest) Fatalf(format string, args ...interface{})
func (*SyncedTest) Log ¶
func (s *SyncedTest) Log(args ...interface{})
func (*SyncedTest) Logf ¶
func (s *SyncedTest) Logf(format string, args ...interface{})
func (*SyncedTest) Name ¶
func (s *SyncedTest) Name() string
func (*SyncedTest) Setenv ¶
func (s *SyncedTest) Setenv(key, value string)
func (*SyncedTest) Skip ¶
func (s *SyncedTest) Skip(args ...interface{})
func (*SyncedTest) SkipNow ¶
func (s *SyncedTest) SkipNow()
func (*SyncedTest) Skipf ¶
func (s *SyncedTest) Skipf(format string, args ...interface{})
func (*SyncedTest) Skipped ¶
func (s *SyncedTest) Skipped() bool
func (*SyncedTest) TempDir ¶
func (s *SyncedTest) TempDir() string
type TestFunc ¶
type TestManyTimesOption ¶
type TestManyTimesOption func(opts *testManyTimesOptions)
func StopAfter ¶
func StopAfter(stopAfter time.Duration) TestManyTimesOption
type TestWriter ¶
func (*TestWriter) Write ¶
func (t *TestWriter) Write(p []byte) (n int, err error)
Source Files ¶
context.go grpclogger.go logs.go manytimes.go test_condition.go waiters.go
- Version
- v3.42.12
- Published
- Mar 3, 2023
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 1 hour ago –
Tools for package owners.