test(e2e): harden release media memory smoke · openclaw/openclaw@99032f0
vincentkoc
·
2026-05-26
·
via Recent Commits to openclaw:main
File tree
scripts/e2e/lib/release-media-memory
| Original file line number | Diff line number | Diff line change |
|---|
@@ -83,8 +83,10 @@ entry="$(openclaw_e2e_package_entrypoint "$package_root")"
|
83 | 83 | printf 'OPENCLAW_STATE_DIR=%s\n' "$OPENCLAW_STATE_DIR" |
84 | 84 | printf 'OPENCLAW_CONFIG_PATH=%s\n' "$OPENCLAW_CONFIG_PATH" |
85 | 85 | } >/tmp/openclaw-release-media-memory-env.log |
86 | | -find "$package_root/dist/extensions/memory-core" -maxdepth 2 -type f -printf '%P\n' \ |
87 | | -| sort >/tmp/openclaw-release-media-memory-package-files.log |
| 86 | +( |
| 87 | +cd "$package_root/dist/extensions/memory-core" |
| 88 | + find . -type f | sed 's#^\./##' | sort |
| 89 | +) >/tmp/openclaw-release-media-memory-package-files.log |
88 | 90 | |
89 | 91 | mock_pid="$(openclaw_e2e_start_mock_openai "$MOCK_PORT" /tmp/openclaw-release-media-memory-openai.log)" |
90 | 92 | openclaw_e2e_wait_mock_openai "$MOCK_PORT" |
@@ -104,7 +106,8 @@ openclaw onboard \
|
104 | 106 | --skip-health >/tmp/openclaw-release-media-memory-onboard.log 2>&1 |
105 | 107 | cp "$OPENCLAW_CONFIG_PATH" /tmp/openclaw-release-media-memory-config.json |
106 | 108 | openclaw plugins list --json >/tmp/openclaw-release-media-memory-plugins.json \ |
107 | | -2>/tmp/openclaw-release-media-memory-plugins.stderr.log || true |
| 109 | +2>/tmp/openclaw-release-media-memory-plugins.stderr.log |
| 110 | +node scripts/e2e/lib/release-scenarios/assertions.mjs assert-file-contains /tmp/openclaw-release-media-memory-plugins.json memory-core |
108 | 111 | node scripts/e2e/lib/release-scenarios/assertions.mjs configure-mock-openai "$MOCK_PORT" |
109 | 112 | |
110 | 113 | mkdir -p "$OPENCLAW_STATE_DIR/workspace/memory" /tmp/openclaw-release-media-memory |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { readFileSync } from "node:fs"; |
| 2 | +import { describe, expect, it } from "vitest"; |
| 3 | + |
| 4 | +const SCENARIO = "scripts/e2e/lib/release-media-memory/scenario.sh"; |
| 5 | + |
| 6 | +describe("release media memory scenario", () => { |
| 7 | +it("fails when packaged plugin listing is broken or omits memory-core", () => { |
| 8 | +const script = readFileSync(SCENARIO, "utf8"); |
| 9 | +const listIndex = script.indexOf( |
| 10 | +"openclaw plugins list --json >/tmp/openclaw-release-media-memory-plugins.json", |
| 11 | +); |
| 12 | +const assertIndex = script.indexOf( |
| 13 | +"assert-file-contains /tmp/openclaw-release-media-memory-plugins.json memory-core", |
| 14 | +); |
| 15 | + |
| 16 | +expect(listIndex).toBeGreaterThanOrEqual(0); |
| 17 | +expect(assertIndex).toBeGreaterThan(listIndex); |
| 18 | +expect(script.slice(listIndex, assertIndex)).not.toContain("|| true"); |
| 19 | +}); |
| 20 | + |
| 21 | +it("uses portable package file listing syntax", () => { |
| 22 | +const script = readFileSync(SCENARIO, "utf8"); |
| 23 | + |
| 24 | +expect(script).not.toContain("-printf"); |
| 25 | +}); |
| 26 | +}); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。