test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Apache Software Foundation (ASF) licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocateFreePorts

func AllocateFreePorts(n int) ([]int, error)

AllocateFreePorts finds n available ports Copied from https://github.com/tendermint/tendermint/issues/3682

func NewEntityEventMatcher

func NewEntityEventMatcher(action databasev1.Action) gomock.Matcher

func NewEtcdListenUrls

func NewEtcdListenUrls() (string, string, error)

func NewShardEventMatcher

func NewShardEventMatcher(action databasev1.Action) gomock.Matcher

func NewSpace

func NewSpace() (tempDir string, deferFunc func(), err error)

func Retry

func Retry(attempts int, sleep time.Duration, f func() error) (err error)

func SetUpModules

func SetUpModules(flags []string, units ...run.Unit) func()

func Space

func Space(t *require.Assertions) (tempDir string, deferFunc func())

Types

type Flow

type Flow interface {
	// PushErrorHandler only pushes a stopFunc
	PushErrorHandler(StopFunc) Flow

	// Run calls the startFunc and expects no error returned.
	// If a non-nil error is returned or panic, shutdown must be called at once.
	// The error will be stored and thus could be checked by the caller later.
	Run(context.Context, StartFunc, StopFunc) Flow

	// RunWithoutSideEffect calls the startFunc and does not expect any side effects from it.
	// If a non-nil error is returned or panic, shutdown must be called at once.
	// The error will be stored and thus could be checked by the caller later.
	RunWithoutSideEffect(context.Context, StartFunc) Flow

	// Shutdown does not actually shutdown the flow,
	// but only returns a function containing all stopFunc(s) to be executed.
	// The timing to do the real shutdown can be determined by users.
	Shutdown() StopFunc

	// Error returns all errors returned from startFunc(s)
	// Nil error imply a successful flow.
	Error() error
}

func NewTestFlow

func NewTestFlow() Flow

NewTestFlow creates a flow ready to prepare services/components to be used for testing.

type StartFunc

type StartFunc func() error

type StopFunc

type StopFunc func()

Directories

Path Synopsis
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements.
traffic
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements.
traffic
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to Apache Software Foundation (ASF) under one or more contributor license agreements.

Jump to

Keyboard shortcuts

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