Integrate cleanup into pipeline execution
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -561,7 +562,7 @@ func TestExecuteStagesPlaceholderSuccessUpdatesManifest(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("executeStages() error = %v", err)
|
||||
}
|
||||
if len(summary.StageNames) != 11 || len(summary.Executed) != 11 || len(summary.Skipped) != 1 || summary.Skipped[0] != "extract" {
|
||||
if len(summary.StageNames) != 12 || len(summary.Executed) != 12 || !reflect.DeepEqual(summary.Skipped, []string{"extract", "cleanup"}) {
|
||||
t.Fatalf("summary = %#v, want full plan with disabled extraction self-skip", summary)
|
||||
}
|
||||
|
||||
@@ -571,14 +572,18 @@ func TestExecuteStagesPlaceholderSuccessUpdatesManifest(t *testing.T) {
|
||||
t.Fatalf("Load manifest error = %v", err)
|
||||
}
|
||||
|
||||
for _, name := range []string{"prepare", "transcribe", "merge", "polish", "normalize", "trim", "extract", "render", "analyze", "publish", "notify"} {
|
||||
for _, name := range []string{"prepare", "transcribe", "merge", "polish", "normalize", "trim", "extract", "render", "analyze", "publish", "notify", "cleanup"} {
|
||||
sr := m.Stages[name]
|
||||
if sr == nil {
|
||||
t.Fatalf("missing stage record %q", name)
|
||||
}
|
||||
if name == "extract" {
|
||||
if sr.Status != manifest.StatusSkipped || sr.Error == nil || sr.Error.Message != "notarius_disabled" {
|
||||
t.Fatalf("extract stage = %#v, want disabled skip", sr)
|
||||
if name == "extract" || name == "cleanup" {
|
||||
wantReason := "notarius_disabled"
|
||||
if name == "cleanup" {
|
||||
wantReason = "cleanup policies are disabled"
|
||||
}
|
||||
if sr.Status != manifest.StatusSkipped || sr.Error == nil || sr.Error.Message != wantReason {
|
||||
t.Fatalf("%s stage = %#v, want disabled skip", name, sr)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user