gauntlet

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t crossdock.T, tt TT, desc string, got interface{}, err error)

Assert verifies the call response against TT

func BuildArgs

func BuildArgs(t crossdock.T, desc string, ft reflect.Type, give []interface{}, initialArgs int) (_ []reflect.Value, ok bool)

BuildArgs creates an args slice than can be used to make a f.Call(args)

func BuildDesc

func BuildDesc(tt TT) string

BuildDesc creates a logging string for the test

We log in one of the following formats,

$Function: $message $Function: $description: $message $Service: $function: $message $Service: $function: $description: $message

func Run

func Run(t crossdock.T)

Run executes the thriftgauntlet behavior.

func RunGauntlet

func RunGauntlet(t crossdock.T, c Config)

RunGauntlet takes an rpc object and runs the gauntlet

Types

type Config

type Config struct {
	Dispatcher *yarpc.Dispatcher

	// Name of the outbound to which the requests will be sent
	ServerName string

	// Whether requests should use Thrift envelopes. Defaults to false.
	Envelope bool

	// Bit mask of the different services to call. Defaults to AllServices.
	Services ServiceSet

	// Extra options for the Thrift client
	ClientOptions []thrift.ClientOption

	// Whether to run oneway tests
	EnableOneway bool
}

Config configures a gauntlet run

type ServiceSet

type ServiceSet int

ServiceSet specifies which services the Gauntlet should make requests to.

const (
	ThriftTest ServiceSet = 1 << iota
	SecondService

	AllServices = ThriftTest | SecondService
)

The different Thrift services that the gauntlet can make requests to.

type TT

type TT struct {
	Service       string   // thrift service name; defaults to ThriftTest
	Function      string   // name of the Go function on the client
	Oneway        bool     // if the function is a oneway function
	SkipOnServers []string // the test is skipped on given servers because it will fail.

	Details string        // optional extra details about what this test does
	Give    []interface{} // arguments besides context

	Want          interface{} // expected response; nil for void
	WantError     error       // expected error
	WantErrorLike string      // for just matching error messages
}

TT is the gauntlets table test struct

Jump to

Keyboard shortcuts

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