Skip to content

Commit 3bab0a3

Browse files
committed
fix tests
1 parent 9d2d583 commit 3bab0a3

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

coderd/database/dbfake/dbfake.go

+2
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ func (q *FakeQuerier) convertToWorkspaceRowsNoLock(ctx context.Context, workspac
338338
AutostartSchedule: w.AutostartSchedule,
339339
Ttl: w.Ttl,
340340
LastUsedAt: w.LastUsedAt,
341+
LockedAt: w.LockedAt,
342+
DeletingAt: w.DeletingAt,
341343
Count: count,
342344
}
343345

coderd/workspaces.go

+1
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
183183
} else {
184184
for _, v := range wss {
185185
if v.DeletingAt == nil {
186+
fmt.Println("FUCK")
186187
continue
187188
}
188189
// get the beginning of the day on which deletion is scheduled

enterprise/cli/licenses.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import (
1212

1313
"golang.org/x/xerrors"
1414

15+
"github.com/google/uuid"
16+
1517
"github.com/coder/coder/cli/clibase"
1618
"github.com/coder/coder/cli/cliui"
1719
"github.com/coder/coder/codersdk"
18-
"github.com/google/uuid"
1920
)
2021

2122
var jwtRegexp = regexp.MustCompile(`^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$`)

enterprise/coderd/templates_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,12 @@ func TestTemplates(t *testing.T) {
264264
Options: &coderdtest.Options{
265265
IncludeProvisionerDaemon: true,
266266
},
267+
LicenseOptions: &coderdenttest.LicenseOptions{
268+
Features: license.Features{
269+
codersdk.FeatureAdvancedTemplateScheduling: 1,
270+
},
271+
},
267272
})
268-
_ = coderdenttest.AddFullLicense(t, client)
269-
270273
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
271274
coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
272275
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)

enterprise/coderd/workspaces_test.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,12 @@ func TestWorkspacesFiltering(t *testing.T) {
633633
Options: &coderdtest.Options{
634634
IncludeProvisionerDaemon: true,
635635
},
636+
LicenseOptions: &coderdenttest.LicenseOptions{
637+
Features: license.Features{
638+
codersdk.FeatureAdvancedTemplateScheduling: 1,
639+
},
640+
},
636641
})
637-
_ = coderdenttest.AddFullLicense(t, client)
638642

639643
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
640644
_ = coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
@@ -684,9 +688,13 @@ func TestWorkspaceLock(t *testing.T) {
684688
IncludeProvisionerDaemon: true,
685689
TemplateScheduleStore: &coderd.EnterpriseTemplateScheduleStore{},
686690
},
691+
LicenseOptions: &coderdenttest.LicenseOptions{
692+
Features: license.Features{
693+
codersdk.FeatureAdvancedTemplateScheduling: 1,
694+
},
695+
},
687696
})
688697

689-
_ = coderdenttest.AddFullLicense(t, client)
690698
version = coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
691699
_ = coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
692700
lockedTTL = time.Minute

0 commit comments

Comments
 (0)