mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
Fix tests
Some checks failed
Deploy PR / check_pr (push) Has been cancelled
Deploy PR / get_info (push) Has been cancelled
Deploy PR / comment-pr (push) Has been cancelled
Deploy PR / build (push) Has been cancelled
Deploy PR / deploy (push) Has been cancelled
Some checks failed
Deploy PR / check_pr (push) Has been cancelled
Deploy PR / get_info (push) Has been cancelled
Deploy PR / comment-pr (push) Has been cancelled
Deploy PR / build (push) Has been cancelled
Deploy PR / deploy (push) Has been cancelled
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
This commit is contained in:
@ -104,7 +104,7 @@ func TestClaimPrebuild(t *testing.T) {
|
|||||||
ctx = dbauthz.AsSystemRestricted(ctx)
|
ctx = dbauthz.AsSystemRestricted(ctx)
|
||||||
|
|
||||||
// Given: a reconciliation completes.
|
// Given: a reconciliation completes.
|
||||||
controller.Reconcile(ctx, nil)
|
require.NoError(t, controller.ReconcileAll(ctx))
|
||||||
|
|
||||||
// Given: a set of running, eligible prebuilds eventually starts up.
|
// Given: a set of running, eligible prebuilds eventually starts up.
|
||||||
runningPrebuilds := make(map[uuid.UUID]database.GetRunningPrebuildsRow, desiredInstances*presetCount)
|
runningPrebuilds := make(map[uuid.UUID]database.GetRunningPrebuildsRow, desiredInstances*presetCount)
|
||||||
|
@ -53,7 +53,7 @@ func TestNoReconciliationActionsIfNoPresets(t *testing.T) {
|
|||||||
require.Equal(t, templateVersion, gotTemplateVersion)
|
require.Equal(t, templateVersion, gotTemplateVersion)
|
||||||
|
|
||||||
// when we trigger the reconciliation loop for all templates
|
// when we trigger the reconciliation loop for all templates
|
||||||
controller.Reconcile(ctx, nil)
|
require.NoError(t, controller.ReconcileAll(ctx))
|
||||||
|
|
||||||
// then no reconciliation actions are taken
|
// then no reconciliation actions are taken
|
||||||
// because without presets, there are no prebuilds
|
// because without presets, there are no prebuilds
|
||||||
@ -109,7 +109,7 @@ func TestNoReconciliationActionsIfNoPrebuilds(t *testing.T) {
|
|||||||
require.NotEmpty(t, presetParameters)
|
require.NotEmpty(t, presetParameters)
|
||||||
|
|
||||||
// when we trigger the reconciliation loop for all templates
|
// when we trigger the reconciliation loop for all templates
|
||||||
controller.Reconcile(ctx, nil)
|
require.NoError(t, controller.ReconcileAll(ctx))
|
||||||
|
|
||||||
// then no reconciliation actions are taken
|
// then no reconciliation actions are taken
|
||||||
// because without prebuilds, there is nothing to reconcile
|
// because without prebuilds, there is nothing to reconcile
|
||||||
@ -316,7 +316,7 @@ func TestActiveTemplateVersionPrebuilds(t *testing.T) {
|
|||||||
templateID,
|
templateID,
|
||||||
)
|
)
|
||||||
|
|
||||||
controller.Reconcile(ctx, nil)
|
require.NoError(t, controller.ReconcileAll(ctx))
|
||||||
|
|
||||||
createdNewPrebuild := false
|
createdNewPrebuild := false
|
||||||
deletedOldPrebuild := true
|
deletedOldPrebuild := true
|
||||||
@ -365,7 +365,7 @@ func TestInactiveTemplateVersionPrebuilds(t *testing.T) {
|
|||||||
// * a third is not running because its latest build was a start transition but the build failed
|
// * a third is not running because its latest build was a start transition but the build failed
|
||||||
// * a fourth is not running because its latest build was a start transition but the build was canceled
|
// * a fourth is not running because its latest build was a start transition but the build was canceled
|
||||||
// when we trigger the reconciliation loop for all templates
|
// when we trigger the reconciliation loop for all templates
|
||||||
controller.Reconcile(ctx, nil)
|
require.NoError(t, controller.ReconcileAll(ctx))
|
||||||
// then the four non running prebuilds are deleted
|
// then the four non running prebuilds are deleted
|
||||||
// and 1 of the running prebuilds is deleted
|
// and 1 of the running prebuilds is deleted
|
||||||
// because stopped, deleted and failed builds are not considered running in terms of the definition of "running" above.
|
// because stopped, deleted and failed builds are not considered running in terms of the definition of "running" above.
|
||||||
|
Reference in New Issue
Block a user