Skip to content

Commit 3c850ad

Browse files
committed
fix tests
1 parent 2bea418 commit 3c850ad

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

coderd/database/dbfake/dbfake.go

+10
Original file line numberDiff line numberDiff line change
@@ -5562,6 +5562,16 @@ func (q *FakeQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg database.
55625562
}
55635563
}
55645564

5565+
// We omit locked workspaces by default.
5566+
if arg.LockedAt.IsZero() && workspace.LockedAt.Valid {
5567+
continue
5568+
}
5569+
5570+
// Filter out workspaces that are locked after the timestamp.
5571+
if !arg.LockedAt.IsZero() && workspace.LockedAt.Time.Before(arg.LockedAt) {
5572+
continue
5573+
}
5574+
55655575
if len(arg.TemplateIDs) > 0 {
55665576
match := false
55675577
for _, id := range arg.TemplateIDs {

coderd/database/queries.sql.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/searchquery/search.go

+5
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ func Workspaces(query string, page codersdk.Pagination, agentInactiveDisconnectT
118118

119119
if _, ok := values["deleting_by"]; ok {
120120
postFilter.DeletingBy = ptr.Ref(parser.Time(values, time.Time{}, "deleting_by", "2006-01-02"))
121+
// We want to make sure to grab locked workspaces since they
122+
// are omitted by default.
123+
if filter.LockedAt.IsZero() {
124+
filter.LockedAt = time.Date(1970, time.January, 1, 0, 0, 0, 0, time.UTC)
125+
}
121126
}
122127

123128
parser.ErrorExcessParams(values)

0 commit comments

Comments
 (0)