testing

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package testing provides testing primitives for the codebase.

Package testing provides testing primitives for the codebase.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFloatRangeTickets added in v0.7.0

func GenerateFloatRangeTickets(manifest1, manifest2 Property) []*pb.Ticket

GenerateFloatRangeTickets takes in two property manifests to generate tickets with two fake properties for testing.

Types

type FakeFrontend

type FakeFrontend struct {
}

FakeFrontend is an empty gRPC handler.

func (*FakeFrontend) CreateTicket

CreateTicket will create a new ticket, assign a Ticket id to it and put the Ticket in state storage. It will then look through the 'properties' field for the attributes defined as indices the matchmakaking config. If the attributes exist and are valid integers, they will be indexed. Creating a ticket adds the Ticket to the pool of Tickets considered for matchmaking.

func (*FakeFrontend) DeleteTicket

DeleteTicket removes the Ticket from state storage and from corresponding configured indices. Deleting the ticket stops the ticket from being considered for future matchmaking requests.

func (*FakeFrontend) GetAssignments

GetAssignments streams matchmaking results from Open Match for the provided Ticket id.

func (*FakeFrontend) GetTicket

func (s *FakeFrontend) GetTicket(ctx context.Context, req *pb.GetTicketRequest) (*pb.Ticket, error)

GetTicket fetches the ticket associated with the specified Ticket id.

type Property

type Property struct {
	Name     string
	Min      float64
	Max      float64
	Interval float64
}

Property defines the required fields that we need to generate tickets for testing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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