Documentation ¶
Index ¶
- func DaprGRPCClient(t *testing.T, ctx context.Context, port int) rtv1.DaprClient
- func FileNames(t *testing.T, num int) []string
- func GetMetaComponents(t require.TestingT, ctx context.Context, client *http.Client, port int) []*rtpbv1.RegisteredComponents
- func HTTPClient(t *testing.T) *http.Client
- func RandomString(t *testing.T, n int) string
- type FreePort
- type ParallelTest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DaprGRPCClient ¶ added in v1.13.0
DaprGRPCClient returns an unauthenticated gRPC client for Dapr whose connection will be closed on test cleanup.
func GetMetaComponents ¶ added in v1.13.0
func HTTPClient ¶
HTTPClient returns a Go http.Client which has a default timeout of 10 seconds, and separate connection pool to the default allowing tests to be properly isolated when running in parallel. The returned client will call CloseIdleConnections on test cleanup.
Types ¶
type FreePort ¶
type FreePort struct {
// contains filtered or unexported fields
}
FreePort reserves a network ports, and then frees them when the test is ready to run.
type ParallelTest ¶ added in v1.13.0
type ParallelTest struct {
// contains filtered or unexported fields
}
ParallelTest is a helper for running tests in parallel without having to create new Go test functions.
func NewParallel ¶ added in v1.13.0
func NewParallel(t *testing.T, fns ...func(*assert.CollectT)) *ParallelTest
NewParallel creates a new ParallelTest. Tests are executed during given test's cleanup.
func (*ParallelTest) Add ¶ added in v1.13.0
func (p *ParallelTest) Add(fn func(*assert.CollectT))
Add adds a test function to be executed in parallel.