mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:10:43 +00:00
fix: stabilize release smoke reruns
This commit is contained in:
@@ -362,6 +362,43 @@ describe("stageBundledPluginRuntimeDeps", () => {
|
||||
expect(fs.existsSync(path.join(pluginDir, ".openclaw-runtime-deps-stamp.json"))).toBe(true);
|
||||
});
|
||||
|
||||
it("skips missing optional runtime deps when copying the installed closure", () => {
|
||||
const { pluginDir, repoRoot } = createBundledPluginFixture({
|
||||
packageJson: {
|
||||
name: "@openclaw/fixture-plugin",
|
||||
version: "1.0.0",
|
||||
dependencies: { direct: "1.0.0" },
|
||||
optionalDependencies: { missingOptional: "1.0.0" },
|
||||
openclaw: { bundle: { stageRuntimeDependencies: true } },
|
||||
},
|
||||
});
|
||||
const directDir = path.join(repoRoot, "node_modules", "direct");
|
||||
fs.mkdirSync(directDir, { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(directDir, "package.json"),
|
||||
'{ "name": "direct", "version": "1.0.0", "optionalDependencies": { "native-extra": "1.0.0" } }\n',
|
||||
"utf8",
|
||||
);
|
||||
fs.writeFileSync(path.join(directDir, "index.js"), "module.exports = 1;\n", "utf8");
|
||||
|
||||
let installCount = 0;
|
||||
stageBundledPluginRuntimeDeps({
|
||||
cwd: repoRoot,
|
||||
installPluginRuntimeDepsImpl: () => {
|
||||
installCount += 1;
|
||||
},
|
||||
});
|
||||
|
||||
expect(installCount).toBe(0);
|
||||
expect(
|
||||
fs.readFileSync(path.join(pluginDir, "node_modules", "direct", "index.js"), "utf8"),
|
||||
).toBe("module.exports = 1;\n");
|
||||
expect(fs.existsSync(path.join(pluginDir, "node_modules", "missingOptional"))).toBe(false);
|
||||
expect(
|
||||
fs.existsSync(path.join(pluginDir, "node_modules", "direct", "node_modules", "native-extra")),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("prunes staged test cargo from copied runtime dependencies", () => {
|
||||
const { pluginDir, repoRoot } = createBundledPluginFixture({
|
||||
packageJson: {
|
||||
|
||||
Reference in New Issue
Block a user