testsuite

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package testsuite provides test environment to run E2E and integration tests..

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eventually

func Eventually(times uint64, interval time.Duration, f func() error) error

Eventually retries the given function n times, sleeping 1s between each invocation. To mark an error as retryable, wrap it in retry.RetryableError. Non-retryable errors return immediately.

Types

type APIClient

type APIClient struct {
	// contains filtered or unexported fields
}

APIClient is a test client for verification API.

func NewAPIClient

func NewAPIClient(addr, key string) (*APIClient, error)

NewAPIClient creates an API server test client.

func (*APIClient) GetCertificate

GetCertificate wraps the VerificationCertificate API call.

func (*APIClient) GetToken

GetToken wraps the VerifyCode API call.

type AdminClient

type AdminClient struct {
	// contains filtered or unexported fields
}

AdminClient is a test client for admin API.

func NewAdminClient

func NewAdminClient(addr, key string) (*AdminClient, error)

NewAdminClient creates an Admin API test client.

func (*AdminClient) IssueCode

IssueCode wraps the IssueCode API call.

type E2ESuite

type E2ESuite struct {
	// contains filtered or unexported fields
}

E2ESuite contains E2E test configs and other useful data.

func NewE2ESuite

func NewE2ESuite(tb testing.TB, ctx context.Context) *E2ESuite

NewE2ESuite returns an E2E test suite.

func (*E2ESuite) NewAPIClient

func (s *E2ESuite) NewAPIClient(context.Context, testing.TB) (*APIClient, error)

NewAPIClient returns an API client.

func (*E2ESuite) NewAdminAPIClient

func (s *E2ESuite) NewAdminAPIClient(context.Context, testing.TB) (*AdminClient, error)

NewAdminAPIClient returns an admin API client.

type IntegrationSuite

type IntegrationSuite struct {
	// contains filtered or unexported fields
}

IntegrationSuite contains the integration test configs and other useful data.

func NewIntegrationSuite

func NewIntegrationSuite(tb testing.TB, ctx context.Context) *IntegrationSuite

NewIntegrationSuite creates a IntegrationSuite for integration tests.

func (*IntegrationSuite) NewAPIClient

func (s *IntegrationSuite) NewAPIClient(ctx context.Context, tb testing.TB) (*APIClient, error)

NewAPIClient runs an API Server and returns a corresponding client.

func (*IntegrationSuite) NewAdminAPIClient

func (s *IntegrationSuite) NewAdminAPIClient(ctx context.Context, tb testing.TB) (*AdminClient, error)

NewAdminAPIClient runs an Admin API Server and returns a corresponding client.

type TestSuite

type TestSuite interface {
	NewAdminAPIClient(ctx context.Context, tb testing.TB) (*AdminClient, error)
	NewAPIClient(ctx context.Context, tb testing.TB) (*APIClient, error)
}

func NewTestSuite

func NewTestSuite(tb testing.TB, ctx context.Context, isE2E bool) TestSuite

NewTestSuite returns environment specific test suite.

Jump to

Keyboard shortcuts

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