test

package
v1.38.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LatencyTest is used to check whether to do latency test for import group.
	LatencyTest = os.Getenv("LATENCY_TEST") == "true"
	// GenerateGolden is used to check whether generating golden.
	GenerateGolden = os.Getenv("GENERATE_GOLDEN") == "true"
)

Functions

func ReadJSON

func ReadJSON(dir, fname string, resp protoreflect.ProtoMessage) error

ReadJSON reads in the golden Json file.

func Setup

func Setup(option ...*TestOption) (pb.MixerClient, pb.ReconClient, error)

Setup creates local server and client.

func SetupBqOnly

func SetupBqOnly() (pb.MixerClient, pb.ReconClient, error)

SetupBqOnly creates local server and client with access to BigQuery only.

func TestDriver

func TestDriver(
	apiName string,
	opt *TestOption,
	testSuite func(pb.MixerClient, pb.ReconClient, bool),
) error

TestDriver drives various tests based on environment flags.

func UpdateGolden

func UpdateGolden(v interface{}, root, fname string)

UpdateGolden updates the golden file for native typed response.

func UpdateProtoGolden

func UpdateProtoGolden(
	resp protoreflect.ProtoMessage, root string, fname string)

UpdateProtoGolden updates the golden file for protobuf response.

Types

type TestOption

type TestOption struct {
	UseCache      bool
	UseMemdb      bool
	SearchOptions server.SearchOptions
}

TestOption holds the options for integration test.

Jump to

Keyboard shortcuts

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