Archive Audita reports as polish diagnostics

This commit is contained in:
2026-09-25 15:51:18 +00:00
parent 77d9d57937
commit 569f467393
9 changed files with 212 additions and 14 deletions

View File

@@ -44,6 +44,28 @@ func TestCommittedRestorePlanUsesOnlyDeclaredObjects(t *testing.T) {
}
}
func TestCommittedRestoreDoesNotRequirePolishRunDiagnostics(t *testing.T) {
cfg := restorePlanConfig(t)
fake := &storage.FakeBackend{}
current := seedCommittedRestoreSnapshot(t, cfg, fake, "20260519T010203Z-a1b2c3d4", map[string][]byte{
"transcripts/full.json": []byte(`{"segments":[]}`),
})
diagnostic := filepath.Join(cfg.Pipeline.Workspace.Root, "runs", current.RunID, "polish", "outputs", "transcripts", "errors.yml")
current.Manifest.Stages["polish"] = &manifest.StageRecord{
Name: "polish", Status: manifest.StatusSucceeded,
Logs: []string{diagnostic},
}
plan, err := buildRestorePlan(context.Background(), cfg, current, fake, RestorePlanOptions{})
if err != nil {
t.Fatalf("buildRestorePlan() error = %v", err)
}
for _, action := range plan.Actions {
if strings.Contains(action.LocalRelativePath, "errors.yml") {
t.Fatalf("diagnostic became a required restore target: %#v", action)
}
}
}
func TestCommittedRestoreDownloadsCarriedOutputFromDeclaredRun(t *testing.T) {
cfg := restorePlanConfig(t)
fake := &storage.FakeBackend{}