fix(ql3): ship local process launcher asset

This commit is contained in:
whyour
2026-08-28 08:31:14 +08:00
parent ce4284ff76
commit 920a31fb66
3 changed files with 59 additions and 13 deletions
+35 -7
View File
@@ -89,19 +89,47 @@ test('rejects Console assets, loopback identity or retained JavaScript drift', (
'--retain-js=local-api/assets/console/console.js',
'--retain-js=local-api/assets/console/unreviewed.js',
)
.replace('io.qinglong.local.console="offline-loopback"', 'io.qinglong.local.console="public"');
.replace(
'io.qinglong.local.console="offline-loopback"',
'io.qinglong.local.console="public"',
);
fs.writeFileSync(dockerfilePath, dockerfile);
const report = auditLocalImageContract(current.root);
assert.equal(report.compatible, false);
assert.ok(
report.findings.some(
({ code }) => code === 'CONSOLE_RUNTIME_NONESSENTIAL_FILES_NOT_REMOVED',
),
);
assert.ok(
report.findings.some(
({ code }) => code === 'CONSOLE_RUNTIME_IDENTITY_OR_LABEL_DRIFT',
),
);
} finally {
current.close();
}
});
test('rejects a Local runtime without the verified process launcher asset', () => {
const current = fixture();
try {
const dockerfilePath = path.join(current.target, 'Dockerfile');
const dockerfile = fs
.readFileSync(dockerfilePath, 'utf8')
.replaceAll(
'COPY --from=workspace /workspace/packages/ql3-local-process/assets \\\n' +
' node_modules/@qinglong/local-process/assets\n',
'',
);
fs.writeFileSync(dockerfilePath, dockerfile);
const report = auditLocalImageContract(current.root);
assert.equal(report.compatible, false);
assert.ok(
report.findings.some(
({ code }) =>
code === 'CONSOLE_RUNTIME_NONESSENTIAL_FILES_NOT_REMOVED',
),
);
assert.ok(
report.findings.some(
({ code }) => code === 'CONSOLE_RUNTIME_IDENTITY_OR_LABEL_DRIFT',
code === 'RUNTIME_INTERNAL_PACKAGE_CLOSURE_DRIFT' ||
code === 'CONSOLE_RUNTIME_INTERNAL_PACKAGE_CLOSURE_DRIFT',
),
);
} finally {