Migrate lock commands to independent objects
This commit is contained in:
@@ -324,9 +324,13 @@ func TestExecuteSessionLocksMutationAcceptsPositionalSessionID(t *testing.T) {
|
||||
if code != 0 {
|
||||
t.Fatalf("locks add exit code = %d, want 0; stderr=%q", code, stderr.String())
|
||||
}
|
||||
key := artifacts.S3SessionLocksKey(artifacts.S3SessionPrefix("dnd", "sample-campaign", "2026-05-03"))
|
||||
if !strings.Contains(string(fake.Objects[key].Data), "reason: review") {
|
||||
t.Fatalf("lock store data = %q, want reason", string(fake.Objects[key].Data))
|
||||
key, err := artifacts.RemoteLockKey(artifacts.S3SessionPrefix("dnd", "sample-campaign", "2026-05-03"), "narratio.transcript.final_trimmed")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
lock, err := artifacts.DecodeRemoteLock(fake.Objects[key].Data)
|
||||
if err != nil || lock.Reason != "review" {
|
||||
t.Fatalf("lock object = %#v, %v; want reason", lock, err)
|
||||
}
|
||||
|
||||
stdout.Reset()
|
||||
@@ -340,12 +344,8 @@ func TestExecuteSessionLocksMutationAcceptsPositionalSessionID(t *testing.T) {
|
||||
if code != 0 {
|
||||
t.Fatalf("locks remove exit code = %d, want 0; stderr=%q", code, stderr.String())
|
||||
}
|
||||
store, err := config.LoadPublishLockStoreBytes("locks.yml", fake.Objects[key].Data, nil, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("LoadPublishLockStoreBytes() error = %v", err)
|
||||
}
|
||||
if len(store.Locks) != 0 {
|
||||
t.Fatalf("locks after remove = %#v, want empty", store.Locks)
|
||||
if _, exists := fake.Objects[key]; exists {
|
||||
t.Fatalf("lock object %q remains after remove", key)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user