Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
63 lines
1.5 KiB
Go
63 lines
1.5 KiB
Go
package sessionreplay
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestSemanticCassetteReaderReturnsValidatedArtifact(t *testing.T) {
|
|
store := &Store{StateDir: t.TempDir()}
|
|
recording := Recording{
|
|
ID: "recording-reader",
|
|
ScopeID: "workspace-reader",
|
|
AgentTargetID: "local:codex",
|
|
ReplayPrerequisites: replayPrerequisitesForTest(),
|
|
Name: "semantic reader",
|
|
RootAgentSessionID: "session-1",
|
|
Mode: ScenarioModeCreateSession,
|
|
}
|
|
completeArtifactCandidate(t, store, recording)
|
|
published, err := store.Publish(
|
|
context.Background(),
|
|
recording,
|
|
"cassette-reader",
|
|
1,
|
|
)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
reader, err := NewSemanticCassetteReader(map[string]string{
|
|
"cassette-reader": published.Layout.StorageKey,
|
|
})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
artifact, err := reader.ReadSemanticCassette(
|
|
context.Background(),
|
|
"cassette-reader",
|
|
)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if artifact.Manifest.ID != "cassette-reader" ||
|
|
artifact.ExpectedState.Agent.RootSessionID != "session-1" ||
|
|
artifact.InitialState != nil ||
|
|
len(artifact.InitialStateRaw) != 0 ||
|
|
len(artifact.CheckpointPlan.Checkpoints) != 2 {
|
|
t.Fatalf("semantic artifact = %#v", artifact)
|
|
}
|
|
}
|
|
|
|
func TestSemanticCassetteReaderRejectsUnregisteredCassette(t *testing.T) {
|
|
reader, err := NewSemanticCassetteReader(nil)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if _, err := reader.ReadSemanticCassette(
|
|
context.Background(),
|
|
"missing",
|
|
); err == nil {
|
|
t.Fatal("unregistered semantic cassette was accepted")
|
|
}
|
|
}
|