func RunEndToEndTest(ctx context.Context, t *testing.T, exp *otlptrace.Exporter, tracesCollector TracesCollector)
RunEndToEndTest can be used by otlptrace.Client tests to validate themselves.
func RunExporterShutdownTest(t *testing.T, factory func() otlptrace.Client)
func SingleReadOnlySpan() []tracesdk.ReadOnlySpan
SingleReadOnlySpan returns a one-element slice with a read-only span. It may be useful for testing driver's trace export.
SpansStorage stores the spans. Mock collectors can use it to store spans they have received.
type SpansStorage struct {
// contains filtered or unexported fields
}
func NewSpansStorage() SpansStorage
NewSpansStorage creates a new spans storage.
func (s *SpansStorage) AddSpans(request *collectortracepb.ExportTraceServiceRequest)
AddSpans adds spans to the spans storage.
func (s *SpansStorage) GetResourceSpans() []*tracepb.ResourceSpans
GetResourceSpans returns the stored resource spans.
func (s *SpansStorage) GetSpans() []*tracepb.Span
GetSpans returns the stored spans.
TracesCollector mocks a collector for the end-to-end testing.
type TracesCollector interface { Stop() error GetResourceSpans() []*tracepb.ResourceSpans }