Keep one verified copy of session audio

This commit is contained in:
2026-11-30 01:41:12 +00:00
parent c07d4f24a2
commit 3094ad892f
39 changed files with 278 additions and 1570 deletions

View File

@@ -285,7 +285,7 @@ inputs:
}
}
func TestSpoolAndPublishDefaults(t *testing.T) {
func TestPublishDefaults(t *testing.T) {
pipelinePath, sessionPath := writeConfigFiles(t, testPipelineBaseYAML, testSessionBaseYAML)
cfg, err := Load(pipelinePath, sessionPath)
@@ -293,12 +293,6 @@ func TestSpoolAndPublishDefaults(t *testing.T) {
t.Fatalf("Load() error = %v", err)
}
if cfg.Pipeline.Spool.Root != "/var/spool/narratio" {
t.Fatalf("spool.root = %q, want /var/spool/narratio", cfg.Pipeline.Spool.Root)
}
if cfg.Pipeline.Spool.DeleteAudioAfterPublish {
t.Fatalf("spool.delete_audio_after_publish = true, want false")
}
if cfg.Pipeline.Workspace.CleanupAfterPublish {
t.Fatalf("workspace.cleanup_after_publish = true, want false")
}
@@ -340,17 +334,13 @@ func TestSpoolAndPublishDefaults(t *testing.T) {
func TestCleanupPoliciesRequireEnabledRunPublication(t *testing.T) {
tests := []struct {
name string
spoolCleanup bool
workspaceCleanup bool
publishEnabled bool
uploadRun bool
wantError bool
}{
{name: "spool cleanup rejects disabled publish", spoolCleanup: true, uploadRun: true, wantError: true},
{name: "workspace cleanup rejects disabled publish", workspaceCleanup: true, uploadRun: true, wantError: true},
{name: "spool cleanup rejects disabled run upload", spoolCleanup: true, publishEnabled: true, wantError: true},
{name: "workspace cleanup rejects disabled run upload", workspaceCleanup: true, publishEnabled: true, wantError: true},
{name: "spool cleanup accepts enabled run publication", spoolCleanup: true, publishEnabled: true, uploadRun: true},
{name: "workspace cleanup accepts enabled run publication", workspaceCleanup: true, publishEnabled: true, uploadRun: true},
}
@@ -361,7 +351,6 @@ func TestCleanupPoliciesRequireEnabledRunPublication(t *testing.T) {
if err != nil {
t.Fatalf("Load() error = %v", err)
}
cfg.Pipeline.Spool.DeleteAudioAfterPublish = test.spoolCleanup
cfg.Pipeline.Workspace.CleanupAfterPublish = test.workspaceCleanup
cfg.Pipeline.Publish.Enabled = &test.publishEnabled
cfg.Pipeline.Publish.UploadRun = &test.uploadRun