Skip to content

Commit 7d627c5

Browse files
committed
fixup! feat: don't return 200 for deleted workspaces
1 parent f7984cd commit 7d627c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/autobuild/executor/lifecycle_executor_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"os"
7+
"strings"
78
"testing"
89
"time"
910

@@ -463,6 +464,9 @@ func mustTransitionWorkspace(t *testing.T, client *codersdk.Client, workspaceID
463464
func mustWorkspace(t *testing.T, client *codersdk.Client, workspaceID uuid.UUID) codersdk.Workspace {
464465
ctx := context.Background()
465466
ws, err := client.Workspace(ctx, workspaceID)
467+
if err != nil && strings.Contains(err.Error(), "status code 410") {
468+
ws, err = client.DeletedWorkspace(ctx, workspaceID)
469+
}
466470
require.NoError(t, err, "no workspace found with id %s", workspaceID)
467471
return ws
468472
}

0 commit comments

Comments
 (0)