Skip to content

Commit 6a3a621

Browse files
committed
🤖 Fix integration test for idempotent deleteWorkspace
Both local and SSH deleteWorkspace are now idempotent - they return success for non-existent workspaces instead of error.
1 parent 71d65f9 commit 6a3a621

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tests/runtime/runtime.test.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,16 +1043,10 @@ describeIntegration("Runtime integration tests", () => {
10431043
// Try to delete a workspace that doesn't exist
10441044
const result = await runtime.deleteWorkspace(workspace.path, "non-existent", false);
10451045

1046-
// For SSH with rm -rf, deleting non-existent directory succeeds (rm -rf is idempotent)
1047-
// For local git worktree, it should fail
1048-
if (type === "local") {
1049-
expect(result.success).toBe(false);
1050-
if (!result.success) {
1051-
expect(result.error).toContain("Failed to remove worktree");
1052-
}
1053-
} else {
1054-
// SSH: rm -rf non-existent is a no-op (succeeds)
1055-
expect(result.success).toBe(true);
1046+
// Both local and SSH deleteWorkspace are now idempotent - return success for non-existent workspaces
1047+
expect(result.success).toBe(true);
1048+
if (result.success) {
1049+
expect(result.deletedPath).toBeDefined();
10561050
}
10571051
});
10581052
});

0 commit comments

Comments
 (0)