integration

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareSliceOfTraces

func CompareSliceOfTraces(t *testing.T, expected []*model.Trace, actual []*model.Trace)

CompareSliceOfTraces compares two trace slices

func CompareTraces

func CompareTraces(t *testing.T, expected *model.Trace, actual *model.Trace)

CompareTraces compares two traces

Types

type QueryFixtures

type QueryFixtures struct {
	Caption          string
	Query            *spanstore.TraceQueryParameters
	ExpectedFixtures []string
}

QueryFixtures and TraceFixtures are under ./fixtures/queries.json and ./fixtures/traces/*.json respectively. Each query fixture includes:

Caption: describes the query we are testing
Query: the query we are testing
ExpectedFixture: the trace fixture that we want back from these queries.

Queries are not necessarily numbered, but since each query requires a service name, the service name is formatted "query##-service".

func LoadAndParseQueryTestCases

func LoadAndParseQueryTestCases(t *testing.T, queriesFile string) []*QueryFixtures

LoadAndParseQueryTestCases loads and parses query test cases

type StorageIntegration

type StorageIntegration struct {
	SpanWriter       spanstore.Writer
	SpanReader       spanstore.Reader
	DependencyWriter dependencystore.Writer
	DependencyReader dependencystore.Reader
	Fixtures         []*QueryFixtures
	// TODO: remove this flag after all storage plugins returns spanKind with operationNames
	NotSupportSpanKindWithOperation bool
	FixturesPath                    string

	// CleanUp() should ensure that the storage backend is clean before another test.
	// called either before or after each test, and should be idempotent
	CleanUp func() error

	// Refresh() should ensure that the storage backend is up to date before being queried.
	// called between set-up and queries in each test
	Refresh func() error
}

StorageIntegration holds components for storage integration test

func (*StorageIntegration) IntegrationTestAll

func (s *StorageIntegration) IntegrationTestAll(t *testing.T)

IntegrationTestAll runs all integration tests

Jump to

Keyboard shortcuts

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