testutil

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDeploymentID

func BuildDeploymentID(t testing.TB) string

BuildDeploymentID allows to create a deploymentID from the test name value

func NewMockClient

func NewMockClient(doer func(*http.Request) (*http.Response, error)) *http.Client

NewMockClient creates an http.Client that will produce the given response

func NewTestConsulInstance

func NewTestConsulInstance(t testing.TB, cfg *config.Configuration) (*testutil.TestServer, *api.Client)

NewTestConsulInstance allows to :

  • creates and returns a new Consul server and client
  • starts a Consul Publisher
  • loads stores
  • stores common-types to Consul

Warning: You need to defer the server stop command in the caller

func NewTestConsulInstanceWithConfig

func NewTestConsulInstanceWithConfig(t testing.TB, cb testutil.ServerConfigCallback, cfg *config.Configuration, storeCommons bool) (*testutil.TestServer, *api.Client)

NewTestConsulInstanceWithConfig sets up a consul instance for testing :

  • creates and returns a new Consul server and client
  • starts a Consul Publisher
  • stores common-types to Consul only if storeCommons bool parameter is true

Warning: You need to defer the server stop command in the caller

func NewTestConsulInstanceWithConfigAndStore

func NewTestConsulInstanceWithConfigAndStore(t testing.TB, cb testutil.ServerConfigCallback, cfg *config.Configuration) (*testutil.TestServer, *api.Client)

NewTestConsulInstanceWithConfigAndStore sets up a consul instance for testing

func SetupTestConfig

func SetupTestConfig(t testing.TB) config.Configuration

SetupTestConfig sets working directory configuration Warning: You need to defer the working directory removal

Types

This section is empty.

Jump to

Keyboard shortcuts

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