Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 7 additions & 5 deletions server.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions test/fixtures/disposable-arr-failure-recovery.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ async function apply() {
assert.equal(backups.response.status, 200);
const backup = backups.payload.backups.find(item => item.planId === state.planId);
assert.ok(backup, 'Controlled failure did not create a rollback record.');
assert.equal(backup.status, 'automatically_rolled_back', `Controlled failure ended in ${backup.status}.`);
assert.equal(backup.status, 'failed', `Fresh-read failure ended in ${backup.status}.`);
state.backupId = backup.id;
fs.writeFileSync(stateFile, JSON.stringify(publicState(state)), {mode:0o600});
console.log('Disposable controlled failure triggered automatic rollback.');
console.log('Disposable fresh-read failure created no upstream writes.');
}

async function verify() {
Expand Down
3 changes: 3 additions & 0 deletions test/orchestration-api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ test('orchestration inventory is owner-only and never exposes upstream secrets',
assert.equal(planPayload.canApply, true);
assert.equal(JSON.stringify(planPayload).includes('must-not-leak'), false);

sonarr.current['/api/v3/config/mediamanagement'].externalSetting = 'changed-after-preview';

const apply = await fetch(`${base}/api/admin/orchestration/plans/${planPayload.planId}/apply`, {
method:'POST',headers:{'content-type':'application/json',cookie:owner.cookie,'x-csrf-token':owner.csrf},body:'{}'
});
Expand All @@ -379,6 +381,7 @@ test('orchestration inventory is owner-only and never exposes upstream secrets',
assert.ok(applied.backup);
assert.equal(sonarr.puts.length + radarr.puts.length, 2);
assert.equal(sonarr.puts[0].body.renameEpisodes, false);
assert.equal(sonarr.puts[0].body.externalSetting, 'changed-after-preview');
assert.equal(radarr.puts[0].body.enableCompletedDownloadHandling, false);

const backupsResponse = await fetch(`${base}/api/admin/orchestration/backups`, {headers:{cookie:owner.cookie}});
Expand Down
Loading