mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 15:10:52 +00:00
fix(ci): align docker smoke cache tests and reuse built dist
This commit is contained in:
@@ -111,7 +111,7 @@ describe("docker build cache layout", () => {
|
||||
expectPatternBeforeInstall(/^COPY(?:\s+--chown=\S+)?\s+extensions \.\/extensions$/m);
|
||||
expectPatternBeforeInstall(/^COPY(?:\s+--chown=\S+)?\s+patches \.\/patches$/m);
|
||||
expectPatternBeforeInstall(
|
||||
/^COPY(?:\s+--chown=\S+)?\s+scripts\/postinstall-bundled-plugins\.mjs scripts\/npm-runner\.mjs scripts\/windows-cmd-helpers\.mjs \.\/scripts\/$/m,
|
||||
/^COPY(?:\s+--chown=\S+)?\s+scripts\/postinstall-bundled-plugins\.mjs scripts\/preinstall-package-manager-warning\.mjs scripts\/npm-runner\.mjs scripts\/windows-cmd-helpers\.mjs \.\/scripts\/$/m,
|
||||
);
|
||||
expectPatternAfterInstall(
|
||||
/^COPY(?:\s+--chown=\S+)?\s+tsconfig\.json tsconfig\.plugin-sdk\.dts\.json tsdown\.config\.ts vitest\.config\.ts openclaw\.mjs \.\/$/m,
|
||||
|
||||
@@ -46,25 +46,17 @@ function bundledEntry(pluginId: string): string {
|
||||
}
|
||||
|
||||
function unifiedDistGraph(): TsdownConfigEntry | undefined {
|
||||
return asConfigArray(tsdownConfig).find((config) => entryKeys(config).includes("index"));
|
||||
return asConfigArray(tsdownConfig).find((config) =>
|
||||
entryKeys(config).includes("plugins/runtime/index"),
|
||||
);
|
||||
}
|
||||
|
||||
describe("tsdown config", () => {
|
||||
it("keeps core, plugin runtime, plugin-sdk, bundled plugins, and bundled hooks in one dist graph", () => {
|
||||
const configs = asConfigArray(tsdownConfig);
|
||||
const distGraphs = configs.filter((config) => {
|
||||
const keys = entryKeys(config);
|
||||
return (
|
||||
keys.includes("index") ||
|
||||
keys.includes("plugins/runtime/index") ||
|
||||
keys.includes("plugin-sdk/index") ||
|
||||
keys.includes(bundledEntry("openai")) ||
|
||||
keys.includes("bundled/boot-md/handler")
|
||||
);
|
||||
});
|
||||
it("keeps core, plugin runtime, plugin-sdk, bundled root plugins, and bundled hooks in one dist graph", () => {
|
||||
const distGraph = unifiedDistGraph();
|
||||
|
||||
expect(distGraphs).toHaveLength(1);
|
||||
expect(entryKeys(distGraphs[0])).toEqual(
|
||||
expect(distGraph).toBeDefined();
|
||||
expect(entryKeys(distGraph as TsdownConfigEntry)).toEqual(
|
||||
expect.arrayContaining([
|
||||
"agents/auth-profiles.runtime",
|
||||
"agents/model-catalog.runtime",
|
||||
@@ -79,14 +71,25 @@ describe("tsdown config", () => {
|
||||
"plugin-sdk/compat",
|
||||
"plugin-sdk/index",
|
||||
bundledEntry("openai"),
|
||||
bundledEntry("matrix"),
|
||||
bundledEntry("msteams"),
|
||||
bundledEntry("whatsapp"),
|
||||
"bundled/boot-md/handler",
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
it("emits staged bundled plugins as separate extension graphs", () => {
|
||||
const stagedGraphs = asConfigArray(tsdownConfig).filter(
|
||||
(config) => typeof config.outDir === "string" && config.outDir.startsWith("dist/extensions/"),
|
||||
);
|
||||
|
||||
expect(stagedGraphs.length).toBeGreaterThan(0);
|
||||
expect(stagedGraphs.every((config) => entryKeys(config).includes("index"))).toBe(true);
|
||||
expect(stagedGraphs.every((config) => !entryKeys(config).includes("plugin-sdk/index"))).toBe(
|
||||
true,
|
||||
);
|
||||
expect(stagedGraphs.some((config) => config.outDir === "dist/extensions/discord")).toBe(true);
|
||||
});
|
||||
|
||||
it("does not emit plugin-sdk or hooks from a separate dist graph", () => {
|
||||
const configs = asConfigArray(tsdownConfig);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user