Skip to content

Commit f735b69

Browse files
committed
best-effort fix but testing dbmem sort order is a waste of time
1 parent ff3cde2 commit f735b69

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

coderd/database/dbmem/dbmem.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -7738,12 +7738,9 @@ func (q *FakeQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg database.
77387738
w2 := workspaces[j]
77397739

77407740
// Order by: favorite first
7741-
if w1.FavoriteOf.Valid && !w2.FavoriteOf.Valid {
7741+
if w1.FavoriteOf == arg.OrderByFavorite {
77427742
return true
77437743
}
7744-
if !w1.FavoriteOf.Valid && w2.FavoriteOf.Valid {
7745-
return false
7746-
}
77477744

77487745
// Order by: running
77497746
w1IsRunning := isRunning(preloadedWorkspaceBuilds[w1.ID], preloadedProvisionerJobs[w1.ID])

coderd/workspaces_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,10 @@ func TestAdminViewAllWorkspaces(t *testing.T) {
479479
func TestWorkspacesSortOrder(t *testing.T) {
480480
t.Parallel()
481481

482+
if !dbtestutil.WillUsePostgres() {
483+
t.Skip("sort order is only tested on postgres")
484+
}
485+
482486
client, db := coderdtest.NewWithDatabase(t, nil)
483487
firstUser := coderdtest.CreateFirstUser(t, client)
484488
secondUserClient, secondUser := coderdtest.CreateAnotherUserMutators(t, client, firstUser.OrganizationID, []string{"owner"}, func(r *codersdk.CreateUserRequest) {

0 commit comments

Comments
 (0)