more otel
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cart
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
@@ -90,7 +91,7 @@ func ptr[T any](v T) *T { return &v }
|
||||
|
||||
func applyOne(t *testing.T, reg actor.MutationRegistry, g *CartGrain, msg proto.Message) actor.ApplyResult {
|
||||
t.Helper()
|
||||
results, err := reg.Apply(g, msg)
|
||||
results, err := reg.Apply(context.Background(), g, msg)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected registry-level error applying %T: %v", msg, err)
|
||||
}
|
||||
@@ -178,7 +179,7 @@ func TestMutationRegistryCoverage(t *testing.T) {
|
||||
}
|
||||
|
||||
// Apply unregistered message -> result should contain ErrMutationNotRegistered, no top-level error
|
||||
results, err := reg.Apply(newTestGrain(), &messages.Noop{})
|
||||
results, err := reg.Apply(context.Background(), newTestGrain(), &messages.Noop{})
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected top-level error applying unregistered mutation: %v", err)
|
||||
}
|
||||
@@ -426,7 +427,7 @@ func TestSubscriptionDetailsMutation(t *testing.T) {
|
||||
applyErrorContains(t, reg, g, &messages.UpsertSubscriptionDetails{Id: &badId}, "not found")
|
||||
|
||||
// Nil mutation should be ignored and produce zero results.
|
||||
resultsNil, errNil := reg.Apply(g, (*messages.UpsertSubscriptionDetails)(nil))
|
||||
resultsNil, errNil := reg.Apply(context.Background(), g, (*messages.UpsertSubscriptionDetails)(nil))
|
||||
if errNil != nil {
|
||||
t.Fatalf("unexpected error for nil mutation element: %v", errNil)
|
||||
}
|
||||
@@ -450,7 +451,7 @@ func TestRegistryDefensiveErrors(t *testing.T) {
|
||||
}
|
||||
|
||||
// Nil message slice
|
||||
results, _ = reg.Apply(g, nil)
|
||||
results, _ = reg.Apply(context.Background(), g, nil)
|
||||
|
||||
if len(results) != 0 {
|
||||
t.Fatalf("expected no results when message slice nil")
|
||||
|
||||
Reference in New Issue
Block a user