From 2de9899a994f0890948cb8be5845df2ab8207f00 Mon Sep 17 00:00:00 2001 From: ChinhLee <76194645+chinhkrb113@users.noreply.github.com> Date: Fri, 27 Mar 2026 22:26:00 +0700 Subject: [PATCH 1/2] docs: undocumented test environment variables The P2P test suite relies on several specific environment variables (e.g., `P2P_TEST_ROOM_ID`, `P2P_TEST_PASSPHRASE`, `P2P_TEST_RELAY`) loaded from `.env` or `.test.env`. Because these are not documented anywhere in the repository, new contributors will be unable to configure their local environment to run the P2P tests successfully. Affected files: vitest.config.p2p.ts Signed-off-by: ChinhLee <76194645+chinhkrb113@users.noreply.github.com> --- vitest.config.p2p.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vitest.config.p2p.ts b/vitest.config.p2p.ts index f66ed09..7772061 100644 --- a/vitest.config.p2p.ts +++ b/vitest.config.p2p.ts @@ -5,6 +5,23 @@ import path from "path"; import dotenv from "dotenv"; import { grantClipboardPermissions, writeHandoffFile, readHandoffFile } from "./test/lib/commands"; +// P2P test environment variables +// Configure these in .env or .test.env, or inject via shell before running tests. +// Shell-injected values take precedence over dotenv files. +// +// Required: +// P2P_TEST_ROOM_ID - Shared room identifier for peers to discover each other +// P2P_TEST_PASSPHRASE - Encryption passphrase shared between test peers +// +// Optional: +// P2P_TEST_HOST_PEER_NAME - Name used to identify the host peer (default varies) +// P2P_TEST_RELAY - WebRTC relay/TURN server URL (falls back to built-in signalling) +// P2P_TEST_APP_ID - Application ID scoping the P2P session +// P2P_TEST_HANDOFF_FILE - File path used to pass state between up/down test phases +// +// General test options (also read from env): +// ENABLE_DEBUGGER - Set to "true" to attach a debugger and pause before tests +// ENABLE_UI - Set to "true" to open a visible browser window during tests const defEnv = dotenv.config({ path: ".env" }).parsed; const testEnv = dotenv.config({ path: ".test.env" }).parsed; // Merge: dotenv files < process.env (so shell-injected vars like P2P_TEST_* take precedence) From b1efbf74c70218d6148dc3f986cd167583dc80a9 Mon Sep 17 00:00:00 2001 From: chinhkrb113 <76194645+chinhkrb113@users.noreply.github.com> Date: Mon, 30 Mar 2026 02:18:25 +0700 Subject: [PATCH 2/2] docs: clarify P2P_TEST_RELAY as Nostr relay --- vitest.config.p2p.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vitest.config.p2p.ts b/vitest.config.p2p.ts index 7772061..a968e9f 100644 --- a/vitest.config.p2p.ts +++ b/vitest.config.p2p.ts @@ -15,7 +15,7 @@ import { grantClipboardPermissions, writeHandoffFile, readHandoffFile } from "./ // // Optional: // P2P_TEST_HOST_PEER_NAME - Name used to identify the host peer (default varies) -// P2P_TEST_RELAY - WebRTC relay/TURN server URL (falls back to built-in signalling) +// P2P_TEST_RELAY - Nostr relay server URL used for peer signalling/discovery // P2P_TEST_APP_ID - Application ID scoping the P2P session // P2P_TEST_HANDOFF_FILE - File path used to pass state between up/down test phases //