Preserve current diagnostics during run cleanup

This commit is contained in:
2026-11-30 01:55:47 +00:00
parent 3118bc35ba
commit 52a5d483e3
6 changed files with 224 additions and 59 deletions

View File

@@ -98,6 +98,22 @@ func TestAttemptViewsRejectConflictingAndUnsafePaths(t *testing.T) {
}
}
func TestManagedAttemptTargetsRejectForeignLinks(t *testing.T) {
root := t.TempDir()
if _, err := BeginAttemptViews(root, "run-one", "polish"); err != nil {
t.Fatal(err)
}
if err := os.Remove(filepath.Join(root, "logs", "polish")); err != nil {
t.Fatal(err)
}
if err := os.Symlink("../../outside", filepath.Join(root, "logs", "polish")); err != nil {
t.Fatal(err)
}
if _, err := ManagedAttemptTargets(root, "run-one"); err == nil {
t.Fatal("accepted foreign diagnostic target")
}
}
func TestAttemptViewsRejectUnsafeIdentities(t *testing.T) {
for _, pair := range [][2]string{{"../escape", "polish"}, {"run", "../outside"}, {"run", ""}, {".preflight", "polish"}} {
if _, err := BeginAttemptViews(t.TempDir(), pair[0], pair[1]); err == nil {