Documentation ¶
Overview ¶
Package namingschematest provides support for automated testing of Go packages using the v1 API. Note that this package is for dd-trace-go.v1 internal testing utilities only. This package is not intended for use by external consumers, no API stability is guaranteed.
Index ¶
- func NewHTTPServerTest(genSpans GenSpansFn, defaultName string, opts ...Option) func(t *testing.T)
- func NewKafkaTest(genSpans GenSpansFn) func(t *testing.T)
- func NewMongoDBTest(genSpans GenSpansFn, defaultServiceName string) func(t *testing.T)
- func NewRedisTest(genSpans GenSpansFn, defaultServiceName string) func(t *testing.T)
- func NewServiceNameTest(genSpans GenSpansFn, wantV0 ServiceNameAssertions) func(t *testing.T)
- func NewSpanNameTest(genSpans GenSpansFn, assertV0 AssertSpansFn, assertV1 AssertSpansFn) func(t *testing.T)
- type AssertSpansFn
- type GenSpansFn
- type Option
- type ServiceNameAssertions
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPServerTest ¶
func NewHTTPServerTest(genSpans GenSpansFn, defaultName string, opts ...Option) func(t *testing.T)
NewHTTPServerTest creates a new test for HTTP server naming schema. This function is not intended for use by external consumers, no API stability is guaranteed.
func NewKafkaTest ¶
func NewKafkaTest(genSpans GenSpansFn) func(t *testing.T)
NewKafkaTest creates a new test for Kafka naming schema. This function is not intended for use by external consumers, no API stability is guaranteed.
func NewMongoDBTest ¶
func NewMongoDBTest(genSpans GenSpansFn, defaultServiceName string) func(t *testing.T)
NewMongoDBTest creates a new test for MongoDB naming schema. This function is not intended for use by external consumers, no API stability is guaranteed.
func NewRedisTest ¶
func NewRedisTest(genSpans GenSpansFn, defaultServiceName string) func(t *testing.T)
NewRedisTest creates a new test for Redis naming schema. This function is not intended for use by external consumers, no API stability is guaranteed.
func NewServiceNameTest ¶
func NewServiceNameTest(genSpans GenSpansFn, wantV0 ServiceNameAssertions) func(t *testing.T)
NewServiceNameTest generates a new test for span service names using the naming schema versioning. This function is not intended for use by external consumers, no API stability is guaranteed.
func NewSpanNameTest ¶
func NewSpanNameTest(genSpans GenSpansFn, assertV0 AssertSpansFn, assertV1 AssertSpansFn) func(t *testing.T)
NewSpanNameTest returns a new test that runs the provided assertion functions for each schema version. This function is not intended for use by external consumers, no API stability is guaranteed.
Types ¶
type AssertSpansFn ¶
type AssertSpansFn = namingschematest.AssertSpansFn
AssertSpansFn allows to make assertions on the generated spans. This type is not intended for use by external consumers, no API stability is guaranteed.
type GenSpansFn ¶
type GenSpansFn = namingschematest.GenSpansFn
GenSpansFn is used across different functions from this package to generate spans. It should be implemented in the tests that use this package. The provided serviceOverride string should be used to set the specific integration's WithService option (if available) when initializing and configuring the package. This type is not intended for use by external consumers, no API stability is guaranteed.
type Option ¶
type Option = namingschematest.Option
Option is a type used to customize behavior of functions in this package. This type is not intended for use by external consumers, no API stability is guaranteed.
func WithServiceNameAssertions ¶
func WithServiceNameAssertions(v Version, s ServiceNameAssertions) Option
WithServiceNameAssertions allows you to override the service name assertions for a specific naming schema version. This function is not intended for use by external consumers, no API stability is guaranteed.
type ServiceNameAssertions ¶
type ServiceNameAssertions = namingschematest.ServiceNameAssertions
ServiceNameAssertions contains assertions for different test cases used inside the generated test from NewServiceNameTest. []string fields in this struct represent the assertions to be made against the returned []mocktracer.Span from GenSpansFn in the same order. This type is not intended for use by external consumers, no API stability is guaranteed.
type Version ¶
type Version = namingschema.Version
Version is a type used to represent the different versions of the naming schema. This type is not intended for use by external consumers, no API stability is guaranteed.