mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(ci): expose AI pack diagnostics (#122786)
This commit is contained in:
@@ -723,7 +723,15 @@ export async function prepareBundledAiRuntimePackage(
|
||||
try {
|
||||
await runCaptureImpl(
|
||||
"pnpm",
|
||||
["--dir", "packages/ai", "pack", "--silent", "--pack-destination", outputDir],
|
||||
[
|
||||
"--dir",
|
||||
"packages/ai",
|
||||
"pack",
|
||||
"--loglevel=error",
|
||||
"--use-stderr",
|
||||
"--pack-destination",
|
||||
outputDir,
|
||||
],
|
||||
sourceDir,
|
||||
{
|
||||
deferForwardedSignalExit: true,
|
||||
|
||||
@@ -495,7 +495,15 @@ describe("package-openclaw-for-docker", () => {
|
||||
outputDir,
|
||||
async (command: string, args: string[], cwd: string) => {
|
||||
expect({ args, command, cwd }).toEqual({
|
||||
args: ["--dir", "packages/ai", "pack", "--silent", "--pack-destination", outputDir],
|
||||
args: [
|
||||
"--dir",
|
||||
"packages/ai",
|
||||
"pack",
|
||||
"--loglevel=error",
|
||||
"--use-stderr",
|
||||
"--pack-destination",
|
||||
outputDir,
|
||||
],
|
||||
command: "pnpm",
|
||||
cwd: sourceDir,
|
||||
});
|
||||
@@ -549,6 +557,37 @@ describe("package-openclaw-for-docker", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps real AI runtime pack failures visible for installer diagnostics", async () => {
|
||||
const sourceDir = tempDirs.make("openclaw-docker-ai-failure-source-");
|
||||
const outputDir = tempDirs.make("openclaw-docker-ai-failure-output-");
|
||||
const packageJsonPath = path.join(sourceDir, "package.json");
|
||||
const originalPackageJson = `${JSON.stringify({
|
||||
dependencies: { "@openclaw/ai": "workspace:*" },
|
||||
name: "openclaw",
|
||||
})}\n`;
|
||||
fs.mkdirSync(path.join(sourceDir, "packages", "ai"), { recursive: true });
|
||||
fs.writeFileSync(
|
||||
path.join(sourceDir, "packages", "ai", "package.json"),
|
||||
'{"name":"@openclaw/ai"}\n',
|
||||
);
|
||||
fs.writeFileSync(packageJsonPath, originalPackageJson);
|
||||
let stderr = "";
|
||||
const stderrWrite = vi.spyOn(process.stderr, "write").mockImplementation((chunk) => {
|
||||
stderr += String(chunk);
|
||||
return true;
|
||||
});
|
||||
|
||||
try {
|
||||
await expect(prepareBundledAiRuntimePackage(sourceDir, outputDir)).rejects.toThrow(
|
||||
"pnpm --dir packages/ai pack --loglevel=error --use-stderr",
|
||||
);
|
||||
expect(stderr).toContain("ERR_PNPM_PACKAGE_VERSION_NOT_FOUND");
|
||||
expect(fs.readFileSync(packageJsonPath, "utf8")).toBe(originalPackageJson);
|
||||
} finally {
|
||||
stderrWrite.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
it("reuses the source manifest lifecycle for ignore-scripts package artifacts", async () => {
|
||||
const sourceDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-docker-manifest-source-"));
|
||||
const outputDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-docker-manifest-output-"));
|
||||
|
||||
Reference in New Issue
Block a user