Artifact 9d3259e09ca9d65702f9afebe4dccecaf91d21a9e42801fefe62d6c9e234a62f:
- File
leaf/telemetry/observer_test.go
— part of check-in
[eda7960b81]
at
2026-04-23 19:23:42
on branch trunk
— rename module to github.com/danmestas/EdgeSync
Fix the case-sensitive module path to match the actual GitHub repo URL (danmestas/EdgeSync). Remove tracked leaf/leaf binary and ignore .claude/skills/ scratchpad dirs. (user: [email protected], size: 992) [annotate] [blame] [check-ins using] [more...]
//go:build !wasip1 && !js package telemetry import ( "testing" libfossil "github.com/danmestas/libfossil" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/sdk/trace/tracetest" ) func TestOTelObserverCreatesSpans(t *testing.T) { exporter := tracetest.NewInMemoryExporter() tp := sdktrace.NewTracerProvider( sdktrace.WithSyncer(exporter), ) obs := NewOTelObserver(tp, nil) obs.Started(libfossil.SessionStart{ Push: true, Pull: true, UV: false, ProjectCode: "abc123", }) obs.RoundStarted(0) obs.RoundCompleted(0, libfossil.RoundStats{FilesSent: 5, FilesRecvd: 3}) obs.Completed(libfossil.SessionEnd{ Rounds: 1, FilesSent: 5, FilesRecvd: 3, }) spans := exporter.GetSpans() if len(spans) != 1 { t.Fatalf("got %d spans, want 1 (session)", len(spans)) } sessionSpan := spans[0] if sessionSpan.Name != "sync.session" { t.Errorf("session span name = %q, want %q", sessionSpan.Name, "sync.session") } }