tester

package module
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 8 Imported by: 0

README

grpc-tester

grpc-tester is a simple command-line tool cum library for testing gRPC services.

This tool leverage grpcurl to create dynamic requests and jq for comparing/validating responses.

NOTE: currently doesn't work on windows cmd/powershell.

DOCUMENTATION is work in progress, have a look at examples/ to get overview of tool usage!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(endpoints []Endpoint)

func Generate

func Generate()

Types

type Endpoint

type Endpoint struct {
	Runner
	Tests []T `json:"tests"`
}

type Lister

type Lister struct {
	Server    string `json:"server"`
	ProtoPath string `json:"proto_path"`
	ProtoFile string `json:"proto_file"`
	TLS       bool   `json:"tls"`
}

func (*Lister) Execute

func (l *Lister) Execute()

func (*Lister) List

func (l *Lister) List() (map[string][]string, error)

type Runner

type Runner struct {
	Lister
	Endpoint      string        `json:"endpoint"`
	Data          []interface{} `json:"-"`
	GrpcurlFlags  string        `json:"-"`
	StreamPayload bool          `json:"stream_payload"`
	// contains filtered or unexported fields
}

func (*Runner) Execute

func (r *Runner) Execute()

func (*Runner) Run

func (r *Runner) Run(reader func(io.ReadCloser) error) error

type T

type T struct {
	ID           string        `json:"id"`
	Description  string        `json:"description"`
	Request      []interface{} `json:"request"`
	Queries      []string      `json:"queries"`
	Compare      bool          `json:"compare"`
	Expectations []interface{} `json:"expectation"`
	Skip         bool          `json:"skip"`
	Response     []interface{} `json:"-"`
	Print        bool          `json:"print"`
	GrpcurlFlags string        `json:"grpcurl_flags"`
	IgnoreOrder  bool          `json:"ignore_order"`
	Pass         bool          `json:"-"`
}

func (*T) Test

func (t *T) Test(r Runner) error

Directories

Path Synopsis
examples
greeter/server command

Jump to

Keyboard shortcuts

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