Honor remote session authoring updates after publication
This commit is contained in:
@@ -120,6 +120,29 @@ func TestPreparedSessionPublishAndRemoteLoad(t *testing.T) {
|
||||
if err != nil || string(restored) != string(fake.Objects[key].Data) {
|
||||
t.Fatalf("restored session = %q, %v", restored, err)
|
||||
}
|
||||
committedBytes := string(fake.Objects[key].Data)
|
||||
if err := sessionInitWithDependencies(ctx, []string{m.SessionID, "--config", pipelinePath, "--campaign-file", campaignPath, "--remote", "--force", "--title", "Updated title", "--audio-s3-prefix", "replacement/"}, &output, deps); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
updated, err := loadCommandConfigWithDependencies(ctx, pipelinePath, "", campaignPath, "", config.SessionLoadOptions{SessionID: m.SessionID}, nil, deps)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer func() { _ = updated.Close() }()
|
||||
if updated.Config.Session.Title != "Updated title" || updated.Config.Session.Inputs.AudioS3 == nil || updated.Config.Session.Inputs.AudioS3.Prefix != "replacement/" {
|
||||
t.Fatalf("remote edit ignored: %#v", updated.Config.Session)
|
||||
}
|
||||
if string(fake.Objects[key].Data) != committedBytes {
|
||||
t.Fatal("authoring update changed committed input")
|
||||
}
|
||||
if _, err := discoverRemoteCurrentState(ctx, updated.Config, fake); err != nil {
|
||||
t.Fatalf("committed state after authoring update: %v", err)
|
||||
}
|
||||
// Remove the authored override to exercise committed-snapshot integrity below.
|
||||
rootKey := artifacts.S3SessionConfigKey(prefix)
|
||||
if err := fake.Delete(ctx, rootKey); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
object := fake.Objects[key]
|
||||
modified := append([]byte(nil), object.Data...)
|
||||
modified[0] ^= 1
|
||||
|
||||
Reference in New Issue
Block a user