Skip to content

Commit 04d1cca

Browse files
committed
nit: rename LifecycleTicker to AutobuildTicker
1 parent fb222ec commit 04d1cca

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

coderd/autobuild/executor/lifecycle_executor_test.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestExecutorAutostartOK(t *testing.T) {
2626
err error
2727
tickCh = make(chan time.Time)
2828
client = coderdtest.New(t, &coderdtest.Options{
29-
LifecycleTicker: tickCh,
29+
AutobuildTicker: tickCh,
3030
})
3131
// Given: we have a user with a workspace
3232
workspace = mustProvisionWorkspace(t, client)
@@ -66,7 +66,7 @@ func TestExecutorAutostartTemplateUpdated(t *testing.T) {
6666
err error
6767
tickCh = make(chan time.Time)
6868
client = coderdtest.New(t, &coderdtest.Options{
69-
LifecycleTicker: tickCh,
69+
AutobuildTicker: tickCh,
7070
})
7171
// Given: we have a user with a workspace
7272
workspace = mustProvisionWorkspace(t, client)
@@ -118,7 +118,7 @@ func TestExecutorAutostartAlreadyRunning(t *testing.T) {
118118
err error
119119
tickCh = make(chan time.Time)
120120
client = coderdtest.New(t, &coderdtest.Options{
121-
LifecycleTicker: tickCh,
121+
AutobuildTicker: tickCh,
122122
})
123123
// Given: we have a user with a workspace
124124
workspace = mustProvisionWorkspace(t, client)
@@ -156,7 +156,7 @@ func TestExecutorAutostartNotEnabled(t *testing.T) {
156156
var (
157157
tickCh = make(chan time.Time)
158158
client = coderdtest.New(t, &coderdtest.Options{
159-
LifecycleTicker: tickCh,
159+
AutobuildTicker: tickCh,
160160
})
161161
// Given: we have a user with a workspace
162162
workspace = mustProvisionWorkspace(t, client)
@@ -189,7 +189,7 @@ func TestExecutorAutostopOK(t *testing.T) {
189189
err error
190190
tickCh = make(chan time.Time)
191191
client = coderdtest.New(t, &coderdtest.Options{
192-
LifecycleTicker: tickCh,
192+
AutobuildTicker: tickCh,
193193
})
194194
// Given: we have a user with a workspace
195195
workspace = mustProvisionWorkspace(t, client)
@@ -229,7 +229,7 @@ func TestExecutorAutostopAlreadyStopped(t *testing.T) {
229229
err error
230230
tickCh = make(chan time.Time)
231231
client = coderdtest.New(t, &coderdtest.Options{
232-
LifecycleTicker: tickCh,
232+
AutobuildTicker: tickCh,
233233
})
234234
// Given: we have a user with a workspace
235235
workspace = mustProvisionWorkspace(t, client)
@@ -267,7 +267,7 @@ func TestExecutorAutostopNotEnabled(t *testing.T) {
267267
var (
268268
tickCh = make(chan time.Time)
269269
client = coderdtest.New(t, &coderdtest.Options{
270-
LifecycleTicker: tickCh,
270+
AutobuildTicker: tickCh,
271271
})
272272
// Given: we have a user with a workspace
273273
workspace = mustProvisionWorkspace(t, client)
@@ -300,7 +300,7 @@ func TestExecutorWorkspaceDeleted(t *testing.T) {
300300
err error
301301
tickCh = make(chan time.Time)
302302
client = coderdtest.New(t, &coderdtest.Options{
303-
LifecycleTicker: tickCh,
303+
AutobuildTicker: tickCh,
304304
})
305305
// Given: we have a user with a workspace
306306
workspace = mustProvisionWorkspace(t, client)
@@ -340,7 +340,7 @@ func TestExecutorWorkspaceTooEarly(t *testing.T) {
340340
err error
341341
tickCh = make(chan time.Time)
342342
client = coderdtest.New(t, &coderdtest.Options{
343-
LifecycleTicker: tickCh,
343+
AutobuildTicker: tickCh,
344344
})
345345
// Given: we have a user with a workspace
346346
workspace = mustProvisionWorkspace(t, client)
@@ -384,10 +384,10 @@ func TestExecutorAutostartMultipleOK(t *testing.T) {
384384
tickCh = make(chan time.Time)
385385
tickCh2 = make(chan time.Time)
386386
client = coderdtest.New(t, &coderdtest.Options{
387-
LifecycleTicker: tickCh,
387+
AutobuildTicker: tickCh,
388388
})
389389
_ = coderdtest.New(t, &coderdtest.Options{
390-
LifecycleTicker: tickCh2,
390+
AutobuildTicker: tickCh2,
391391
})
392392
// Given: we have a user with a workspace
393393
workspace = mustProvisionWorkspace(t, client)

coderd/coderdtest/coderdtest.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type Options struct {
6161
GoogleTokenValidator *idtoken.Validator
6262
SSHKeygenAlgorithm gitsshkey.Algorithm
6363
APIRateLimit int
64-
LifecycleTicker <-chan time.Time
64+
AutobuildTicker <-chan time.Time
6565
}
6666

6767
// New constructs an in-memory coderd instance and returns
@@ -77,9 +77,9 @@ func New(t *testing.T, options *Options) *codersdk.Client {
7777
options.GoogleTokenValidator, err = idtoken.NewValidator(ctx, option.WithoutAuthentication())
7878
require.NoError(t, err)
7979
}
80-
if options.LifecycleTicker == nil {
80+
if options.AutobuildTicker == nil {
8181
ticker := make(chan time.Time)
82-
options.LifecycleTicker = ticker
82+
options.AutobuildTicker = ticker
8383
t.Cleanup(func() { close(ticker) })
8484
}
8585

@@ -111,7 +111,7 @@ func New(t *testing.T, options *Options) *codersdk.Client {
111111
ctx,
112112
db,
113113
slogtest.Make(t, nil).Named("autobuild.executor").Leveled(slog.LevelDebug),
114-
options.LifecycleTicker,
114+
options.AutobuildTicker,
115115
)
116116
lifecycleExecutor.Run()
117117

0 commit comments

Comments
 (0)