testing

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReportMetrics

func ReportMetrics(tb testing.TB, exporter metric.Exporter) *metric.MeterProvider

ReportMetrics sets up a MeterProvider for metrics reporting and returns it along with a cleanup function.

	func TestWithMetrics(t *testing.T) {
    exporter := glossymetric.NewTest(t)
	  mp := oteltesting.ReportMetrics(t, exporter)
	}

func ReportTraces

func ReportTraces(tb testing.TB, exporter trace.SpanExporter) *trace.TracerProvider

ReportTraces configures a trace provider for collecting and reporting spans, with cleanup on test completion.

	func TestWithTrace(t *testing.T) {
    exporter := glossytrace.NewTest(t, glossytrace.WithFlamegraph(), glossytrace.WithSpanAttributes())
	  tp := testingx.ReportTraces(t, exporter)
	}

func TestMainReportMetrics

func TestMainReportMetrics(m *testing.M, exporter metric.Exporter) (*metric.MeterProvider, func())

TestMainReportMetrics sets up a MeterProvider with a metric exporter for testing and returns it along with a flush function.

	func TestMain(m *testing.M) {
   exporter := glossymetric.NewTestingM(m)
		mp, flush := oteltesting.TestMainReportMetrics(m, exporter)
	}

Types

This section is empty.

Jump to

Keyboard shortcuts

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