helpers

package
v0.0.0-...-d19fc40 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrokerEventTransformationMetricsTestHelper

func BrokerEventTransformationMetricsTestHelper(client *lib.Client, projectID string, brokerURL url.URL, brokerName string)

func BrokerEventTransformationTestHelper

func BrokerEventTransformationTestHelper(client *lib.Client, brokerURL url.URL, brokerName string, needRetry bool)

func BrokerEventTransformationTestWithAuditLogsSourceHelper

func BrokerEventTransformationTestWithAuditLogsSourceHelper(client *lib.Client, authConfig lib.AuthConfig, brokerURL url.URL, brokerName string)

func BrokerEventTransformationTestWithPubSubSourceHelper

func BrokerEventTransformationTestWithPubSubSourceHelper(client *lib.Client, authConfig lib.AuthConfig, brokerURL url.URL, brokerName string)

func BrokerEventTransformationTestWithSchedulerSourceHelper

func BrokerEventTransformationTestWithSchedulerSourceHelper(client *lib.Client, authConfig lib.AuthConfig, brokerURL url.URL, brokerName string)

func BrokerEventTransformationTestWithStorageSourceHelper

func BrokerEventTransformationTestWithStorageSourceHelper(client *lib.Client, authConfig lib.AuthConfig, brokerURL url.URL, brokerName string)

func BrokerEventTransformationTracingTestHelper

func BrokerEventTransformationTracingTestHelper(client *lib.Client, projectID string, brokerURL url.URL, brokerName string)

func CreateKService

func CreateKService(client *lib.Client, imageName string) string

func VerifyTrace

func VerifyTrace(t *testing.T, testTree TestSpanTree, projectID string, traceID string)

Types

type SpanMatcher

type SpanMatcher struct {
	Name   string
	Kind   *cloudtrace.TraceSpan_SpanKind
	Labels map[string]string
}

func (*SpanMatcher) MatchesSpan

func (m *SpanMatcher) MatchesSpan(span *cloudtrace.TraceSpan) error

type SpanTree

type SpanTree struct {
	Span     *cloudtrace.TraceSpan
	Children []SpanTree
}

SpanTree is the tree of Spans representation of a Trace.

func GetTraceTree

func GetTraceTree(trace *cloudtrace.Trace) (*SpanTree, error)

GetTraceTree converts a set slice of spans into a SpanTree.

type TestSpanTree

type TestSpanTree struct {
	Name     string
	Span     *SpanMatcher
	Children []TestSpanTree
}

TestSpanTree is the expected version of SpanTree used for assertions in testing.

func BrokerTestTree

func BrokerTestTree(namespace string, brokerName string, trigger string, respTrigger string) TestSpanTree

func (TestSpanTree) MatchesSubtree

func (tt TestSpanTree) MatchesSubtree(t *testing.T, actual *SpanTree) (matches [][]SpanTree)

MatchesSubtree checks to see if this TestSpanTree matches a subtree of the actual SpanTree. It is intended to be used for assertions while testing. Returns the set of possible subtree matches with the corresponding set of unmatched siblings.

Jump to

Keyboard shortcuts

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