Documentation ¶
Index ¶
- Variables
- func ReadJSON(dir, fname string, resp protoreflect.ProtoMessage) error
- func Setup(option ...*TestOption) (pb.MixerClient, pb.ReconClient, error)
- func SetupBqOnly() (pb.MixerClient, pb.ReconClient, error)
- func TestDriver(apiName string, opt *TestOption, ...) error
- func UpdateGolden(v interface{}, root, fname string)
- func UpdateProtoGolden(resp protoreflect.ProtoMessage, root string, fname string)
- type TestOption
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.
Click to show internal directories.
Click to hide internal directories.