fix(e2e): validate plugin fixture stop attempts · openclaw/openclaw@34d402f
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -390,6 +390,39 @@ test -d "$OPENCLAW_PLUGINS_TMP_DIR"
|
390 | 390 | } |
391 | 391 | }); |
392 | 392 | |
| 393 | +it("rejects invalid fixture stop attempts before cleanup polling", () => { |
| 394 | +const result = spawnSync( |
| 395 | +"/bin/bash", |
| 396 | +[ |
| 397 | +"-c", |
| 398 | +[ |
| 399 | +"set -euo pipefail", |
| 400 | +"source scripts/e2e/lib/plugins/fixtures.sh", |
| 401 | +"openclaw_plugins_signal_fixture_process() { echo signal; }", |
| 402 | +"openclaw_plugins_fixture_process_alive() { echo probe; return 1; }", |
| 403 | +"set +e", |
| 404 | +"openclaw_plugins_stop_fixture_process 12345", |
| 405 | +'status="$?"', |
| 406 | +"set -e", |
| 407 | +'exit "$status"', |
| 408 | +].join("\n"), |
| 409 | +], |
| 410 | +{ |
| 411 | +cwd: process.cwd(), |
| 412 | +encoding: "utf8", |
| 413 | +env: { |
| 414 | + ...process.env, |
| 415 | +OPENCLAW_PLUGINS_FIXTURE_STOP_ATTEMPTS: "2x", |
| 416 | +}, |
| 417 | +}, |
| 418 | +); |
| 419 | + |
| 420 | +expect(result.status).toBe(2); |
| 421 | +expect(result.stderr).toContain("invalid OPENCLAW_PLUGINS_FIXTURE_STOP_ATTEMPTS: 2x"); |
| 422 | +expect(result.stdout).not.toContain("signal"); |
| 423 | +expect(result.stdout).not.toContain("probe"); |
| 424 | +}); |
| 425 | + |
393 | 426 | it("bounds npm fixture registry logs when readiness fails", () => { |
394 | 427 | const root = mkdtempSync(path.join(tmpdir(), "openclaw-plugin-npm-fixture-log-")); |
395 | 428 | try { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。