@@ -14,6 +14,7 @@ import (
1414 "github.com/coder/coder/coderd/autobuild/schedule"
1515 "github.com/coder/coder/coderd/coderdtest"
1616 "github.com/coder/coder/coderd/database"
17+ "github.com/coder/coder/coderd/util/ptr"
1718 "github.com/coder/coder/codersdk"
1819
1920 "github.com/google/uuid"
@@ -44,7 +45,7 @@ func TestExecutorAutostartOK(t *testing.T) {
4445 sched , err := schedule .Weekly ("* * * * *" )
4546 require .NoError (t , err )
4647 require .NoError (t , client .UpdateWorkspaceAutostart (ctx , workspace .ID , codersdk.UpdateWorkspaceAutostartRequest {
47- Schedule : sched .String (),
48+ Schedule : ptr . Ref ( sched .String () ),
4849 }))
4950
5051 // When: the autobuild executor ticks
@@ -95,7 +96,7 @@ func TestExecutorAutostartTemplateUpdated(t *testing.T) {
9596 sched , err := schedule .Weekly ("* * * * *" )
9697 require .NoError (t , err )
9798 require .NoError (t , client .UpdateWorkspaceAutostart (ctx , workspace .ID , codersdk.UpdateWorkspaceAutostartRequest {
98- Schedule : sched .String (),
99+ Schedule : ptr . Ref ( sched .String () ),
99100 }))
100101
101102 // When: the autobuild executor ticks
@@ -138,7 +139,7 @@ func TestExecutorAutostartAlreadyRunning(t *testing.T) {
138139 sched , err := schedule .Weekly ("* * * * *" )
139140 require .NoError (t , err )
140141 require .NoError (t , client .UpdateWorkspaceAutostart (ctx , workspace .ID , codersdk.UpdateWorkspaceAutostartRequest {
141- Schedule : sched .String (),
142+ Schedule : ptr . Ref ( sched .String () ),
142143 }))
143144
144145 // When: the autobuild executor ticks
@@ -316,12 +317,12 @@ func TestExecutorAutostopNotEnabled(t *testing.T) {
316317 })
317318 // Given: we have a user with a workspace that has no TTL set
318319 workspace = mustProvisionWorkspace (t , client , func (cwr * codersdk.CreateWorkspaceRequest ) {
319- cwr .TTL = nil
320+ cwr .TTLMillis = nil
320321 })
321322 )
322323
323324 // Given: workspace has no TTL set
324- require .Nil (t , workspace .TTL )
325+ require .Nil (t , workspace .TTLMillis )
325326
326327 // Given: workspace is running
327328 require .Equal (t , codersdk .WorkspaceTransitionStart , workspace .LatestBuild .Transition )
@@ -359,7 +360,7 @@ func TestExecutorWorkspaceDeleted(t *testing.T) {
359360 sched , err := schedule .Weekly ("* * * * *" )
360361 require .NoError (t , err )
361362 require .NoError (t , client .UpdateWorkspaceAutostart (ctx , workspace .ID , codersdk.UpdateWorkspaceAutostartRequest {
362- Schedule : sched .String (),
363+ Schedule : ptr . Ref ( sched .String () ),
363364 }))
364365
365366 // Given: workspace is deleted
@@ -402,7 +403,7 @@ func TestExecutorWorkspaceAutostartTooEarly(t *testing.T) {
402403 sched , err := schedule .Weekly (futureTimeCron )
403404 require .NoError (t , err )
404405 require .NoError (t , client .UpdateWorkspaceAutostart (ctx , workspace .ID , codersdk.UpdateWorkspaceAutostartRequest {
405- Schedule : sched .String (),
406+ Schedule : ptr . Ref ( sched .String () ),
406407 }))
407408
408409 // When: the autobuild executor ticks
@@ -461,7 +462,7 @@ func TestExecutorWorkspaceAutostopNoWaitChangedMyMind(t *testing.T) {
461462 )
462463
463464 // Given: the user changes their mind and decides their workspace should not auto-stop
464- err := client .UpdateWorkspaceTTL (ctx , workspace .ID , codersdk.UpdateWorkspaceTTLRequest {TTL : nil })
465+ err := client .UpdateWorkspaceTTL (ctx , workspace .ID , codersdk.UpdateWorkspaceTTLRequest {TTLMillis : nil })
465466 require .NoError (t , err )
466467
467468 // When: the autobuild executor ticks after the deadline
0 commit comments