Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: enforce template-level constraints for TTL and autostart#2018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 commit
Commits
Show all changes
20 commits
Select commitHold shift + click to select a range
1713431
RED: add failing unit tests
johnstcnJun 2, 2022
f11f942
RED: add migrations and make gen
johnstcnJun 2, 2022
c5c9a7a
ORANGE: fix audit/diff tests
johnstcnJun 2, 2022
74f4dee
fixup! RED: add migrations and make gen
johnstcnJun 2, 2022
7da27a0
fixup! RED: add migrations and make gen
johnstcnJun 2, 2022
5ad048b
feat: schedule: add schedule.Min function to determine minimum interval
johnstcnJun 2, 2022
65b980e
ORANGE: coderd: fix a whole bunch of tests
johnstcnJun 2, 2022
aa298a6
RED: fast-fail some slow-failing tests
johnstcnJun 2, 2022
a5ec9bf
GREEN: fix even more tests
johnstcnJun 3, 2022
a6255d6
GREEN: fix final unit test
johnstcnJun 3, 2022
245795e
cli: templatecreate: add CLI flags --max-ttl --min-autostart-interval
johnstcnJun 3, 2022
709db5b
fixup! cli: templatecreate: add CLI flags --max-ttl --min-autostart-i…
johnstcnJun 3, 2022
c4a0927
make gen
johnstcnJun 3, 2022
244e479
update test entities
johnstcnJun 3, 2022
60ef479
Merge remote-tracking branch 'origin/main' into 1433-template-constra…
johnstcnJun 7, 2022
c9aab8b
fixup! Merge remote-tracking branch 'origin/main' into 1433-template-…
johnstcnJun 7, 2022
f997af2
coderd: default newly-minted workspaces to template max_ttl
johnstcnJun 7, 2022
d7f697b
address PR comment
johnstcnJun 7, 2022
ebe4c15
fix broken unit test
johnstcnJun 7, 2022
08ef2eb
fix some more tests
johnstcnJun 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
GREEN: fix final unit test
  • Loading branch information
@johnstcn
johnstcn committedJun 3, 2022
commita6255d69fc93674cd223b1b74acbe03a55b7f67c
11 changes: 7 additions & 4 deletionscoderd/autobuild/executor/lifecycle_executor_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -456,6 +456,7 @@ func TestExecutorAutostartMultipleOK(t *testing.T) {
t.Parallel()

var (
sched = mustSchedule(t, "CRON_TZ=UTC 0 * * * *")
tickCh = make(chan time.Time)
tickCh2 = make(chan time.Time)
statsCh1 = make(chan executor.Stats)
Expand All@@ -471,15 +472,17 @@ func TestExecutorAutostartMultipleOK(t *testing.T) {
AutobuildStats: statsCh2,
})
// Given: we have a user with a workspace that has autostart enabled (default)
workspace = mustProvisionWorkspace(t, client)
workspace = mustProvisionWorkspace(t, client, func(cwr *codersdk.CreateWorkspaceRequest) {
cwr.AutostartSchedule = ptr.Ref(sched.String())
})
)
// Given: workspace is stopped
workspace = mustTransitionWorkspace(t, client, workspace.ID, database.WorkspaceTransitionStart, database.WorkspaceTransitionStop)

// When: the autobuild executor ticks
// When: the autobuild executor ticks past the scheduled time
go func() {
tickCh <-time.Now().UTC().Add(time.Minute)
tickCh2 <-time.Now().UTC().Add(time.Minute)
tickCh <-sched.Next(workspace.LatestBuild.CreatedAt)
tickCh2 <-sched.Next(workspace.LatestBuild.CreatedAt)
close(tickCh)
close(tickCh2)
}()
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp