Skip to content

Commit f520d28

Browse files
authored
fix: reset Mnemosyne test runtime fallbacks (#7)
Co-authored-by: gitcommit90 <gitcommit90@users.noreply.github.com>
1 parent 3a51e9b commit f520d28

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4545

4646
### Fixed
4747

48+
- Apple Silicon release validation now retries the macOS system Python from a
49+
clean virtual environment when a preferred Homebrew Python leaves a partial
50+
one behind, so the pinned Mnemosyne test runtime can be prepared reliably.
4851
- Fresh hosts now open the 1Helm server while the optional Mnemosyne Python
4952
and embedding runtime is prepared in the background, instead of making
5053
first launch and health checks wait on virtual-environment package installs.

scripts/run-test-suite.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ if (!runtime) {
2323
const venv = join(disposableRoot, "venv");
2424
const installers = [...new Set([process.env.PYTHON || "", "python3", ...(process.platform === "darwin" ? ["/usr/bin/python3"] : [])].filter(Boolean))];
2525
for (const installer of installers) {
26+
// A failed interpreter can leave a partial venv whose Python symlinks
27+
// poison the next fallback attempt. Each interpreter must start from its
28+
// own clean disposable runtime, matching the production bootstrap.
29+
if (existsSync(venv)) rmSync(venv, { recursive: true, force: true });
2630
if (spawnSync(installer, ["-m", "venv", venv], { stdio: "ignore" }).status !== 0) continue;
2731
const candidate = join(venv, pythonName);
2832
const installed = spawnSync(candidate, ["-m", "pip", "install", "--disable-pip-version-check", "--no-input", "--ignore-requires-python", `mnemosyne-memory==${version}`], { stdio: "inherit" });

test/desktop.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ test("desktop entrypoint keeps the renderer sandboxed and data on the Mac", asyn
147147
assert.match(memoryRuntime, /export function prepareMnemosyneRuntime\(\): Promise<boolean>/, "fresh-host memory installation is asynchronous instead of blocking application startup");
148148
assert.match(memoryRuntime, /export function cancelMnemosyneRuntimePreparation\(\)/, "host shutdown cancels an in-flight app-managed memory installation");
149149
assert.match(testRunner, /MNEMOSYNE_PYTHON: runtime/, "the full test suite shares one explicit pinned memory runtime instead of racing app-start installers");
150+
assert.match(testRunner, /if \(existsSync\(venv\)\) rmSync\(venv, \{ recursive: true, force: true \}\);[\s\S]*spawnSync\(installer/, "each test-runtime fallback starts clean after a preferred Python leaves a partial venv");
150151
assert.match(feedbackBrowser, /skip: executablePath \? false :/, "the Feedback browser contract does not hang a Chrome-free release runner");
151152
assert.match(terminalBrowser, /HELM_CHANNEL_COMPUTER_BACKEND: "native"/, "the terminal browser contract uses the explicit development backend on CI hosts without an installed LXC runtime");
152153
const serverRuntime = await readFile(join(root, "src", "server", "index.ts"), "utf8");

0 commit comments

Comments
 (0)