From 2e1a16cb7d70dd0bb56e3d706a086746536c1f62 Mon Sep 17 00:00:00 2001 From: Jay Zeng Date: Mon, 17 Aug 2026 23:17:46 -0700 Subject: [PATCH] test: isolate Pro install from production Signed-off-by: Jay Zeng --- CHANGELOG.md | 6 ++++++ test/cli.test.ts | 10 +++++++++- test/fixtures/plugin-service-unavailable.ts | 11 +++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/plugin-service-unavailable.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 197d2b7..460f14a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Unreleased + +### Fixed + +- Isolated the anonymous Pro-install CLI test from the live production service so a healthy preview deployment cannot make the deterministic Core suite fail. + ## [0.4.17] - 2026-08-17 ### Added diff --git a/test/cli.test.ts b/test/cli.test.ts index 9166b98..7b21aee 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -634,7 +634,15 @@ describe("CLI subprocess", () => { test("non-interactive plugin install attempts anonymous preview access without requiring identity", () => { const pluginDir = path.join(tmpDir, "plugin-install"); const result = Bun.spawnSync( - ["bun", "run", path.join(__dirname, "..", "src", "cli.ts"), "plugin", "install", "--json"], + [ + "bun", + "--preload", + path.join(__dirname, "fixtures", "plugin-service-unavailable.ts"), + path.join(__dirname, "..", "src", "cli.ts"), + "plugin", + "install", + "--json", + ], { env: { ...process.env, AGENT_MEMORY_PLUGIN_DIR: pluginDir }, stdout: "pipe", diff --git a/test/fixtures/plugin-service-unavailable.ts b/test/fixtures/plugin-service-unavailable.ts new file mode 100644 index 0000000..d087a39 --- /dev/null +++ b/test/fixtures/plugin-service-unavailable.ts @@ -0,0 +1,11 @@ +globalThis.fetch = async () => + new Response( + JSON.stringify({ + schemaVersion: 1, + error: { code: "service_unavailable", message: "Test plugin service is unavailable" }, + }), + { + status: 503, + headers: { "content-type": "application/json" }, + }, + );