frametests

package
v1.65.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort added in v1.56.0

func GetFreePort(ctx context.Context) (int, error)

func WaitForCheckedConditionWithResult added in v1.54.12

func WaitForCheckedConditionWithResult[T any](
	ctx context.Context,
	condition func() (*T, error), canReturnChecker func(*T, error) bool,
	timeout time.Duration,
	pollInterval time.Duration,
) (*T, error)

WaitForCheckedConditionWithResult polls a condition function until it returns a non-nil result or timeout occurs This is useful when you need to wait for a specific result from an operation.

func WaitForConditionWithResult added in v1.54.12

func WaitForConditionWithResult[T any](
	ctx context.Context,
	condition func() (*T, error),
	timeout time.Duration,
	pollInterval time.Duration,
) (*T, error)

WaitForConditionWithResult polls a condition function until it returns a non-nil result or timeout occurs This is useful when you need to wait for a specific result from an operation.

func WithHTTPTestDriver added in v1.58.1

func WithHTTPTestDriver() (frame.Option, func() *httptest.Server)

WithHTTPTestDriver uses a driver, mostly useful when writing tests against the frame service.

func WithNoopDriver added in v1.56.1

func WithNoopDriver() frame.Option

WithNoopDriver uses a no-op driver, mostly useful when writing tests against the frame service.

func WithTestDependencies added in v1.64.1

func WithTestDependencies(t *testing.T,
	options []*definition.DependencyOption,
	testFn func(t *testing.T, opt *definition.DependencyOption))

WithTestDependencies runs subtests for each provided DependencyOption. It ensures each subtest is properly isolated and runs in parallel if desired.

Types

type FrameBaseTestSuite

type FrameBaseTestSuite struct {
	suite.Suite
	Network *testcontainers.DockerNetwork

	Ctrl *gomock.Controller

	InitResourceFunc func(ctx context.Context) []definition.TestResource
	// contains filtered or unexported fields
}

FrameBaseTestSuite provides a base test suite with all necessary test components.

func (*FrameBaseTestSuite) Resources

func (s *FrameBaseTestSuite) Resources() []definition.DependancyConn

func (*FrameBaseTestSuite) SetupSuite

func (s *FrameBaseTestSuite) SetupSuite()

SetupSuite initialises the test environment for the test suite.

func (*FrameBaseTestSuite) TearDownSuite

func (s *FrameBaseTestSuite) TearDownSuite()

TearDownSuite cleans up resources after all tests are completed.

Directories

Path Synopsis
deps

Jump to

Keyboard shortcuts

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