helpers

package
v0.39.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChannelNameSuffix = "Channel"
)

Variables

This section is empty.

Functions

func BrokerConsumerDataPlaneTestHelper added in v0.23.0

func BrokerConsumerDataPlaneTestHelper(
	ctx context.Context,
	t *testing.T,
	brokerClass string,
	brokerTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

At consumer No upgrade of version Attributes received should be the same as produced (attributes may be added) Events are filtered Events are delivered to multiple subscribers Deliveries succeed at least once Replies are accepted and delivered Replies that are unsuccessfully forwarded cause initial message to be redelivered (Very difficult to test, can be ignored)

func BrokerDataPlaneNamespaceSetupOption added in v0.18.0

func BrokerDataPlaneNamespaceSetupOption(ctx context.Context, namespace string) testlib.SetupClientOption

func BrokerDataPlaneSetupHelper added in v0.17.0

func BrokerDataPlaneSetupHelper(ctx context.Context, client *testlib.Client, brokerClass string, brokerTestRunner testlib.ComponentsTestRunner) *eventingv1.Broker

func BrokerIngressDataPlaneTestHelper added in v0.23.0

func BrokerIngressDataPlaneTestHelper(
	ctx context.Context,
	t *testing.T,
	brokerClass string,
	brokerTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption)

At ingress Supports CE 0.3 or CE 1.0 via HTTP Supports structured or Binary mode Respond with 2xx on good CE Respond with 400 on bad CE Reject non-POST, non-OPTIONS requests to publish URI (beyond spec?!)

func BrokerTracingTestHelperWithChannelTestRunner added in v0.10.0

func BrokerTracingTestHelperWithChannelTestRunner(
	ctx context.Context,
	t *testing.T,
	brokerClass string,
	channelTestRunner testlib.ComponentsTestRunner,
	setupClient testlib.SetupClientOption,
)

BrokerTracingTestHelperWithChannelTestRunner runs the Broker tracing tests for all Channels in the ComponentsTestRunner.

func BrokerV1ControlPlaneTest added in v0.23.0

func BrokerV1ControlPlaneTest(
	t *testing.T,
	brokerCreator BrokerCreator,
	setupClient ...testlib.SetupClientOption,
)

This tests if the broker control plane: 1. Trigger can be created before Broker (with attributes filter) 2. Broker can be created and progresses to Ready 3. Ready Broker is Addressable 4. Broker.Spec.Config is immutable 5. Trigger with Ready broker progresses to Ready 6. Trigger with no broker, updated with broker, updates status to include subscriberURI 7. Ready Trigger includes status.subscriberUri

func ChannelCRDMetadataTestHelperWithChannelTestRunner added in v0.15.0

func ChannelCRDMetadataTestHelperWithChannelTestRunner(
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

ChannelCRDMetadataTestHelperWithChannelTestRunner runs the Channel CRD metadata tests for all Channel resources in the ComponentsTestRunner. Deprecated, use reconciler-test based tests.

func ChannelCRDNameTestHelperWithChannelTestRunner added in v0.15.0

func ChannelCRDNameTestHelperWithChannelTestRunner(
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

ChannelCRDNameTestHelperWithChannelTestRunner runs the Channel CRD name tests for all Channel resources in the ComponentsTestRunner.

func ChannelDataPlaneFailureTestRunner added in v0.16.0

func ChannelDataPlaneFailureTestRunner(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

ChannelDataPlaneFailureTestRunner tests some status codes from the spec

func ChannelDataPlaneSuccessTestRunner added in v0.16.0

func ChannelDataPlaneSuccessTestRunner(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

ChannelDataPlaneSuccessTestRunner tests the support of the channel ingress for different spec versions and message modes

func ChannelSpecTestHelperWithChannelTestRunner added in v0.15.0

func ChannelSpecTestHelperWithChannelTestRunner(
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

func ChannelStatusSubscriberTestHelperWithChannelTestRunner added in v0.15.0

func ChannelStatusSubscriberTestHelperWithChannelTestRunner(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

ChannelStatusSubscriberTestHelperWithChannelTestRunner runs the tests of subscriber field of status for all Channels in the ComponentsTestRunner.

func ChannelStatusTestHelperWithChannelTestRunner added in v0.15.0

func ChannelStatusTestHelperWithChannelTestRunner(
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

ChannelStatusTestHelperWithChannelTestRunner runs the Channel status tests for all Channels in the ComponentsTestRunner.

func ChannelTracingTestHelperWithChannelTestRunner added in v0.10.0

func ChannelTracingTestHelperWithChannelTestRunner(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	setupClient testlib.SetupClientOption,
)

ChannelTracingTestHelperWithChannelTestRunner runs the Channel tracing tests for all Channels in the ComponentsTestRunner.

func ServiceAccountCanDoVerbOnResourceOrFail added in v0.16.0

func ServiceAccountCanDoVerbOnResourceOrFail(client *testlib.Client, gvr schema.GroupVersionResource, subresource string, saName string, verb string)

Deprecated

func SingleEventWithKnativeHeaderHelperForChannelTestHelper added in v0.16.0

func SingleEventWithKnativeHeaderHelperForChannelTestHelper(
	ctx context.Context,
	t *testing.T,
	encoding cloudevents.Encoding,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

SingleEventWithKnativeHeaderHelperForChannelTestHelper is the helper function for header_test

func TestChannelAddressableResolverClusterRoleTestRunner added in v0.16.0

func TestChannelAddressableResolverClusterRoleTestRunner(
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

Deprecated

func TestChannelChannelableManipulatorClusterRoleTestRunner added in v0.15.0

func TestChannelChannelableManipulatorClusterRoleTestRunner(
	ctx context.Context,
	t *testing.T,
	channelTestRunner testlib.ComponentsTestRunner,
	options ...testlib.SetupClientOption,
)

Deprecated

func ValidateAnnotations added in v0.21.0

func ValidateAnnotations(client *testlib.Client, object metav1.TypeMeta, annotationsKey string)

func ValidateRequiredLabels added in v0.17.0

func ValidateRequiredLabels(client *testlib.Client, object metav1.TypeMeta, labels map[string]string)

Types

type BrokerCreator added in v0.17.0

type BrokerCreator func(client *testlib.Client, name string)

Creates a Broker with the given name.

type EventTypesAnnotationJsonValue added in v0.21.0

type EventTypesAnnotationJsonValue struct {
	Type        string `json:"type"`
	Schema      string `json:"schema,omitempty"`
	Description string `json:"description,omitempty"`
}

type SetupTracingTestInfrastructureFunc added in v0.16.0

type SetupTracingTestInfrastructureFunc func(
	ctx context.Context,
	t *testing.T,
	channel *metav1.TypeMeta,
	client *testlib.Client,
	loggerPodName string,
	senderPublishTrace bool,
) (tracinghelper.TestSpanTree, cetest.EventMatcher)

SetupTracingTestInfrastructureFunc sets up the infrastructure for running tracing tests. It returns the expected trace as well as a string that is expected to be in the logger Pod's logs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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