mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
fix(e2e): bound plugin assertion log reads
This commit is contained in:
@@ -208,7 +208,7 @@ test -d "$OPENCLAW_PLUGINS_TMP_DIR"
|
||||
}
|
||||
});
|
||||
|
||||
it("scans plugin update logs without echoing whole files on failure", async () => {
|
||||
it("scans plugin assertion logs without echoing whole files on failure", async () => {
|
||||
const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-update-log-"));
|
||||
try {
|
||||
const passRoot = path.join(root, "pass");
|
||||
@@ -237,6 +237,27 @@ test -d "$OPENCLAW_PLUGINS_TMP_DIR"
|
||||
expect(fail.stderr).toContain("Output tail:");
|
||||
expect(fail.stderr).toContain("missing marker tail");
|
||||
expect(fail.stderr.length).toBeLessThan(20 * 1024);
|
||||
|
||||
const invalidRoot = path.join(root, "invalid");
|
||||
const invalidHome = path.join(root, "home");
|
||||
mkdirSync(invalidRoot, { recursive: true });
|
||||
mkdirSync(invalidHome, { recursive: true });
|
||||
writeFileSync(
|
||||
path.join(invalidRoot, "plugins-invalid-openclaw-extensions.log"),
|
||||
`openclaw.extensions[1]\n${"x".repeat(256 * 1024)}\nmissing validation tail`,
|
||||
"utf8",
|
||||
);
|
||||
writeJson(path.join(invalidRoot, "plugins-invalid-openclaw-extensions-list.json"), {
|
||||
plugins: [],
|
||||
});
|
||||
const invalid = await runAssertionAsync(["invalid-openclaw-extensions"], {
|
||||
HOME: invalidHome,
|
||||
OPENCLAW_PLUGINS_TMP_DIR: invalidRoot,
|
||||
});
|
||||
expect(invalid.status).toBe(1);
|
||||
expect(invalid.stderr).toContain("malformed metadata install output");
|
||||
expect(invalid.stderr).toContain("missing validation tail");
|
||||
expect(invalid.stderr.length).toBeLessThan(20 * 1024);
|
||||
} finally {
|
||||
rmSync(root, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user