fix(coderd): update references to workspace's include_deleted query param (#25826)

fixes DEVEX-206
This commit is contained in:
Andrew Aquino
2026-06-04 09:12:45 -07:00
committed by GitHub
parent 61a35185cf
commit 6bd413163f
2 changed files with 6 additions and 6 deletions
+5 -5
View File
@@ -91,7 +91,7 @@ func TestWorkspace(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()
// Getting with deleted=true should still work.
// Getting with include_deleted=true should still work.
_, err := client.DeletedWorkspace(ctx, workspace.ID)
require.NoError(t, err)
@@ -102,12 +102,12 @@ func TestWorkspace(t *testing.T) {
require.NoError(t, err, "delete the workspace")
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, build.ID)
// Getting with deleted=true should work.
// Getting with include_deleted=true should work.
workspaceNew, err := client.DeletedWorkspace(ctx, workspace.ID)
require.NoError(t, err)
require.Equal(t, workspace.ID, workspaceNew.ID)
// Getting with deleted=false should not work.
// Getting with include_deleted=false should not work.
_, err = client.Workspace(ctx, workspace.ID)
require.Error(t, err)
require.ErrorContains(t, err, "410") // gone
@@ -1517,12 +1517,12 @@ func TestWorkspaceByOwnerAndName(t *testing.T) {
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, build.ID)
// Then:
// When we call without includes_deleted, we don't expect to get the workspace back
// When we call without include_deleted, we don't expect to get the workspace back
_, err = client.WorkspaceByOwnerAndName(ctx, workspace.OwnerName, workspace.Name, codersdk.WorkspaceOptions{})
require.ErrorContains(t, err, "404")
// Then:
// When we call with includes_deleted, we should get the workspace back
// When we call with include_deleted, we should get the workspace back
workspaceNew, err := client.WorkspaceByOwnerAndName(ctx, workspace.OwnerName, workspace.Name, codersdk.WorkspaceOptions{IncludeDeleted: true})
require.NoError(t, err)
require.Equal(t, workspace.ID, workspaceNew.ID)