fix: reject malformed generated roots
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
2026-07-31 19:25:44 -05:00
parent f710a8d7fb
commit 98046a76a2
4 changed files with 28 additions and 10 deletions
+11
View File
@@ -128,6 +128,17 @@ test('generated-state symbolic links are accepted only when exactly build-certif
assert.match(result.message, /symbolic link/);
});
await t.test('apps/web/.next is rejected when it is not a directory', async () => {
const root = await fixture('non-directory-next-root');
await installRequiredBins(root);
await writeFile(path.join(root, 'apps', 'web', '.next'), 'not a Next build\n');
const result = await runPreflight({ root });
assert.equal(result.code, 43);
assert.match(result.message, /MOSAIC_PREFLIGHT_GENERATED_STATE/);
assert.match(result.message, /real directory/);
});
await t.test('an added descendant symlink is rejected', async () => {
const root = await fixture('symbolic-next-added');
await installRequiredBins(root);