triggertest

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InvokeEventRecorder

func InvokeEventRecorder(
	suite *processorsuite.TestSuite,
	host string,
	createFunctionOptions *platform.CreateFunctionOptions,
	expectedMessagesPerTopic map[string]TopicMessages,
	numNonExpectedMessagesPerTopic map[string]TopicMessages,
	messagePublisher MessagePublisher,
	postPublishChecks *PostPublishChecks)

Types

type AbstractBrokerSuite

type AbstractBrokerSuite struct {
	processorsuite.TestSuite

	BrokerHost                 string
	FunctionPaths              map[string]string
	BrokerContainerID          string
	BrokerContainerNetworkName string
	SkipStartBrokerContainer   bool

	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewAbstractBrokerSuite

func NewAbstractBrokerSuite(brokerSuite BrokerSuite) *AbstractBrokerSuite

func (*AbstractBrokerSuite) EnsureDockerNetworkExisting

func (suite *AbstractBrokerSuite) EnsureDockerNetworkExisting()

func (*AbstractBrokerSuite) GetContainerRunInfo

func (suite *AbstractBrokerSuite) GetContainerRunInfo() (string, *dockerclient.RunOptions)

func (*AbstractBrokerSuite) RunContainer

func (suite *AbstractBrokerSuite) RunContainer(imageName string,
	runOptions *dockerclient.RunOptions) string

func (*AbstractBrokerSuite) SendHTTPRequest

func (suite *AbstractBrokerSuite) SendHTTPRequest(request *Request) (*http.Response, error)

func (*AbstractBrokerSuite) SetupSuite

func (suite *AbstractBrokerSuite) SetupSuite()

func (*AbstractBrokerSuite) StartBrokerContainer

func (suite *AbstractBrokerSuite) StartBrokerContainer(imageName string,
	runOptions *dockerclient.RunOptions)

func (*AbstractBrokerSuite) TearDownSuite

func (suite *AbstractBrokerSuite) TearDownSuite()

func (*AbstractBrokerSuite) WaitForBroker

func (suite *AbstractBrokerSuite) WaitForBroker() error

WaitForBroker waits until the broker is ready

type BrokerSuite

type BrokerSuite interface {

	// GetContainerRunInfo returns information about the broker container
	GetContainerRunInfo() (string, *dockerclient.RunOptions)

	// WaitForBroker waits until the broker is ready
	WaitForBroker() error
}

BrokerSuite tests a broker by producing messages

type Event

type Event struct {
	Body      string            `json:"body"`
	Headers   map[string]string `json:"headers"`
	Timestamp string            `json:"timestamp"`
}

func GetEventRecorderReceivedEvents

func GetEventRecorderReceivedEvents(logger logger.Logger,
	functionHost string,
	functionPort int) ([]Event, error)

type MessagePublisher

type MessagePublisher func(string, string) error

type PostPublishChecks

type PostPublishChecks struct {
	ValidateAckFunction              func(consumerGroup string, topic string, expectedNumberOfCommittedOffsets int) bool
	ExpectedNumberOfCommittedOffsets int
	ConsumerGroup                    string
}

type Request

type Request struct {
	Port     int
	Url      string
	Path     string
	Method   string
	Body     string
	Loglevel string
	Headers  map[string]interface{}
}

type TopicMessages

type TopicMessages struct {
	NumMessages         int
	CustomMessagePrefix string
}

Jump to

Keyboard shortcuts

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