Rebuild beta and campaign file activations
This commit is contained in:
@@ -128,6 +128,29 @@ describe('campaign resume API', () => {
|
||||
}
|
||||
);
|
||||
|
||||
it('upgrades queued file restarts without replaying submitted operations', async () => {
|
||||
await heldRollback('pending');
|
||||
const { db } = await import('../../src/lib/server/db/index.js');
|
||||
const { requestRestart } = await import('../../src/lib/server/provisioning/requests.js');
|
||||
const job = requestRestart(server, { kind: 'campaign', id: campaign });
|
||||
expect(job.action).toBe('rebuild');
|
||||
db().prepare("UPDATE server_deployments SET action='restart' WHERE id=?").run(job.id);
|
||||
expect(requestRestart(server, { kind: 'campaign', id: campaign })).toMatchObject({
|
||||
id: job.id,
|
||||
action: 'rebuild'
|
||||
});
|
||||
db()
|
||||
.prepare(
|
||||
"UPDATE server_deployments SET action='restart',state='running',submitted_at=? WHERE id=?"
|
||||
)
|
||||
.run(new Date().toISOString(), job.id);
|
||||
expect(requestRestart(server, { kind: 'campaign', id: campaign })).toMatchObject({
|
||||
id: job.id,
|
||||
action: 'restart',
|
||||
state: 'running'
|
||||
});
|
||||
});
|
||||
|
||||
it('retains an existing waiting operation when its held campaign resumes', async () => {
|
||||
await heldRollback();
|
||||
const { requestRestart } = await import('../../src/lib/server/provisioning/requests.js');
|
||||
|
||||
Reference in New Issue
Block a user