





















@@ -500,6 +500,52 @@ test -d "$OPENCLAW_PLUGINS_TMP_DIR"
500500}
501501});
502502503+it("rejects invalid plugin fixture log byte limits before npm fixture setup", () => {
504+const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-npm-fixture-log-invalid-"));
505+try {
506+const binDir = path.join(root, "bin");
507+const fixtureDir = path.join(root, "fixture");
508+mkdirSync(binDir, { recursive: true });
509+mkdirSync(fixtureDir);
510+writeFileSync(
511+path.join(binDir, "node"),
512+"#!/bin/bash\necho node should not run >&2\nexit 1\n",
513+);
514+chmodSync(path.join(binDir, "node"), 0o755);
515+516+const result = spawnSync(
517+"/bin/bash",
518+[
519+"-c",
520+[
521+"set -euo pipefail",
522+"source scripts/e2e/lib/plugins/fixtures.sh",
523+"set +e",
524+`start_npm_fixture_registry fixture-pkg 1.0.0 ${shellQuote(path.join(root, "fixture.tgz"))} ${shellQuote(fixtureDir)}`,
525+'status="$?"',
526+"set -e",
527+'exit "$status"',
528+].join("\n"),
529+],
530+{
531+cwd: process.cwd(),
532+encoding: "utf8",
533+env: {
534+ ...process.env,
535+OPENCLAW_DOCKER_E2E_LOG_PRINT_BYTES: "64kb",
536+PATH: `${binDir}${path.delimiter}/usr/bin${path.delimiter}/bin`,
537+},
538+},
539+);
540+541+expect(result.status).toBe(2);
542+expect(result.stderr).toContain("invalid OPENCLAW_DOCKER_E2E_LOG_PRINT_BYTES: 64kb");
543+expect(result.stderr).not.toContain("node should not run");
544+} finally {
545+rmSync(root, { force: true, recursive: true });
546+}
547+});
548+503549it("cleans ClawHub fixture children when readiness times out", () => {
504550const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-clawhub-fixture-cleanup-"));
505551try {
@@ -548,6 +594,55 @@ test -d "$OPENCLAW_PLUGINS_TMP_DIR"
548594}
549595});
550596597+it("rejects invalid plugin fixture log byte limits before ClawHub fixture setup", () => {
598+const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-clawhub-fixture-log-invalid-"));
599+try {
600+const binDir = path.join(root, "bin");
601+const tmpDir = path.join(root, "scratch");
602+mkdirSync(binDir, { recursive: true });
603+mkdirSync(tmpDir);
604+writeFileSync(
605+path.join(binDir, "node"),
606+"#!/bin/bash\necho node should not run >&2\nexit 1\n",
607+);
608+chmodSync(path.join(binDir, "node"), 0o755);
609+610+const result = spawnSync(
611+"/bin/bash",
612+[
613+"-c",
614+[
615+"set -euo pipefail",
616+"source scripts/e2e/lib/plugins/fixtures.sh",
617+"source scripts/e2e/lib/plugins/clawhub.sh",
618+"set +e",
619+"run_plugins_clawhub_scenario",
620+'status="$?"',
621+"set -e",
622+'exit "$status"',
623+].join("\n"),
624+],
625+{
626+cwd: process.cwd(),
627+encoding: "utf8",
628+env: {
629+ ...process.env,
630+OPENCLAW_DOCKER_E2E_LOG_PRINT_BYTES: "64kb",
631+OPENCLAW_PLUGINS_E2E_LIVE_CLAWHUB: "0",
632+OPENCLAW_PLUGINS_TMP_DIR: tmpDir,
633+PATH: `${binDir}${path.delimiter}/usr/bin${path.delimiter}/bin`,
634+},
635+},
636+);
637+638+expect(result.status).toBe(2);
639+expect(result.stderr).toContain("invalid OPENCLAW_DOCKER_E2E_LOG_PRINT_BYTES: 64kb");
640+expect(result.stderr).not.toContain("node should not run");
641+} finally {
642+rmSync(root, { force: true, recursive: true });
643+}
644+});
645+551646it("bounds ClawHub fixture server logs when readiness fails", () => {
552647const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-clawhub-fixture-log-"));
553648try {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。