This commit is contained in:
@@ -136,6 +136,7 @@ it.each(['dry-run', 'create-only'])('turns saved %s policies off once on upgrade
|
||||
"UPDATE autoscaling_policies SET mode=?,settings=json_set(settings,'$.mode',?) WHERE id=?"
|
||||
)
|
||||
.run(mode, mode, saved.id);
|
||||
db().pragma('user_version = 0');
|
||||
closeDb();
|
||||
const migrated = scaling.getScalingPolicy(saved.id)!;
|
||||
expect(migrated).toMatchObject({
|
||||
@@ -177,6 +178,7 @@ it.each([false, true])(
|
||||
db()
|
||||
.prepare('UPDATE server_deployments SET submitted_at=? WHERE id=?')
|
||||
.run(new Date().toISOString(), id);
|
||||
db().pragma('user_version = 0');
|
||||
closeDb();
|
||||
expect(scaling.getScalingPolicy(saved.id)?.mode).toBe('off');
|
||||
expect(
|
||||
@@ -211,6 +213,7 @@ it('removes saved cooldowns on upgrade without changing the empty hold or pausin
|
||||
"UPDATE autoscaling_policies SET next_action_at=?,settings=json_set(settings,'$.cooldownMinutes',60) WHERE id=?"
|
||||
)
|
||||
.run(Date.now() + 3600_000, saved.id);
|
||||
db().pragma('user_version = 0');
|
||||
closeDb();
|
||||
const restored = scaling.getScalingPolicy(saved.id)!;
|
||||
expect(restored).toEqual(saved);
|
||||
|
||||
Reference in New Issue
Block a user