more otel
All checks were successful
Build and Publish / Metadata (push) Successful in 11s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 53s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m49s

This commit is contained in:
2025-11-13 21:40:20 +01:00
parent cebd3ea80f
commit af5d4cd325
10 changed files with 98 additions and 69 deletions

View File

@@ -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")