Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/mcp-server/test/integration/e2e-apps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,16 @@ const ALL_APPS = [
];

// ─── Test suite ───────────────────────────────────────────────────────────────
// These tests require macOS with Automation permissions and real apps running.
// Gate behind APPLESCRIPT_E2E=1 and skip automatically in CI.

describe("E2E app tests", () => {
const skipReason: string | undefined = process.env.CI
? "Skipped in CI environment (set APPLESCRIPT_E2E=1 and unset CI to run)"
: !process.env.APPLESCRIPT_E2E
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gate is documented as APPLESCRIPT_E2E=1, but the check uses truthiness (!process.env.APPLESCRIPT_E2E). Values like APPLESCRIPT_E2E=0 are truthy and would incorrectly enable these tests. Consider checking explicitly for the expected value (e.g., process.env.APPLESCRIPT_E2E === "1") so the flag behaves as documented.

Suggested change
: !process.env.APPLESCRIPT_E2E
: process.env.APPLESCRIPT_E2E !== "1"

Copilot uses AI. Check for mistakes.
? "Set APPLESCRIPT_E2E=1 to run E2E tests locally"
: undefined;
Comment on lines +115 to +119
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipReason currently doesn't enforce the documented "macOS required" constraint. If someone sets APPLESCRIPT_E2E=1 on Linux/Windows (or runs on a non-darwin CI runner), the suite will still execute and likely fail/hang. Consider adding a process.platform !== "darwin" skip reason (with a clear message) so the suite can never run off-macOS.

Suggested change
const skipReason: string | undefined = process.env.CI
? "Skipped in CI environment (set APPLESCRIPT_E2E=1 and unset CI to run)"
: !process.env.APPLESCRIPT_E2E
? "Set APPLESCRIPT_E2E=1 to run E2E tests locally"
: undefined;
const skipReason: string | undefined =
process.platform !== "darwin"
? "AppleScript E2E tests require macOS (process.platform !== 'darwin')"
: process.env.CI
? "Skipped in CI environment (set APPLESCRIPT_E2E=1 and unset CI to run)"
: !process.env.APPLESCRIPT_E2E
? "Set APPLESCRIPT_E2E=1 to run E2E tests locally"
: undefined;

Copilot uses AI. Check for mistakes.

describe("E2E app tests", { skip: skipReason }, () => {
before(async () => {
const env = { ...process.env };
delete env["APPLESCRIPT_MCP_CONFIG"];
Expand Down