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 actor
import (
"context"
"errors"
"reflect"
"slices"
@@ -78,7 +79,7 @@ func TestRegisteredMutationBasics(t *testing.T) {
// Apply happy path
state := &cartState{}
add := &messages.AddItem{ItemId: 42, Quantity: 3, Sku: "ABC"}
if _, err := reg.Apply(state, add); err != nil {
if _, err := reg.Apply(context.Background(), state, add); err != nil {
t.Fatalf("Apply returned error: %v", err)
}
if state.calls != 1 {
@@ -94,12 +95,12 @@ func TestRegisteredMutationBasics(t *testing.T) {
}
// Apply nil message
if _, err := reg.Apply(state, nil); err == nil {
if _, err := reg.Apply(context.Background(), state, nil); err == nil {
t.Fatalf("expected error for nil mutation message")
}
// Apply unregistered message
if _, err := reg.Apply(state, &messages.Noop{}); !errors.Is(err, ErrMutationNotRegistered) {
if _, err := reg.Apply(context.Background(), state, &messages.Noop{}); !errors.Is(err, ErrMutationNotRegistered) {
t.Fatalf("expected ErrMutationNotRegistered, got %v", err)
}
}