Documentation
¶
Overview ¶
Package testutil holds test helpers shared across framingo's own packages and usable by apps built on it: a SQLite-backed db.Manager, and doubles for the model interfaces a component receives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRecorder ¶ added in v0.6.12
func NewRecorder() (*tracetest.InMemoryExporter, *sdktrace.TracerProvider)
NewRecorder pairs an in-memory exporter with a synchronous provider, so a span is readable the moment it ends - no flush, no sleep, no polling.
Types ¶
type Tracer ¶ added in v0.6.12
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is a model.Tracer whose provider can be replaced mid-flight, the way a tracing-service restart replaces it in production. The provider it hands out is whatever the test supplied - pair it with NewRecorder for a real SDK provider writing to a real in-memory exporter, so only the service wrapper is a double.
func NewTracer ¶ added in v0.6.12
func NewTracer(p trace.TracerProvider) *Tracer
NewTracer returns a Tracer serving p. Reach for it when a test needs to swap the provider mid-flight, which the real tracing service only does through Init; a test that just needs some model.Tracer is better served by tracing.New(), which serves a noop provider with no Init, config or exporter.
func (*Tracer) Dependencies ¶ added in v0.6.12
func (*Tracer) Propagator ¶ added in v0.6.12
func (t *Tracer) Propagator() propagation.TextMapPropagator
func (*Tracer) Provider ¶ added in v0.6.12
func (t *Tracer) Provider() trace.TracerProvider
func (*Tracer) Swap ¶ added in v0.6.12
func (t *Tracer) Swap(p trace.TracerProvider)
Swap replaces the provider, standing in for a tracing-service restart.