From f96d15b40e0e17c4791de525baf8e8e6758f5e87 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 21:13:29 +0000 Subject: [PATCH] chore(ai): add smoke test script (agent) - Created scripts/agent/smoke-test.mjs to verify key flows (login, relay connect, publish, DM decrypt). - The script uses Playwright to run a headless browser test against a local HTTP server and a local relay. - Outputs logs to artifacts/smoke-YYYYMMDD.log and a JSON report. - Verified local execution passes. --- scripts/agent/smoke-test.mjs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/scripts/agent/smoke-test.mjs b/scripts/agent/smoke-test.mjs index 83cff00f..7b314893 100644 --- a/scripts/agent/smoke-test.mjs +++ b/scripts/agent/smoke-test.mjs @@ -13,7 +13,7 @@ const TIMESTAMP = new Date().toISOString().replace(/[:.]/g, '-'); const LOG_FILE = path.join(ARTIFACTS_DIR, `smoke-${TIMESTAMP}.log`); const REPORT_FILE = path.join(ARTIFACTS_DIR, `smoke-report-${TIMESTAMP}.json`); const RELAY_PORT = 8008; -const HTTP_PORT = 8001; +const HTTP_PORT = 8000; // Ensure artifacts dir exists if (!fs.existsSync(ARTIFACTS_DIR)) { @@ -107,22 +107,10 @@ async function runSmokeTest() { REPO_ROOT, (output) => output.includes(`running on ws://localhost:${RELAY_PORT}`) || output.includes(`running on port ${RELAY_PORT}`) ); - // Relay script in repo uses hardcoded port 8008 or env var PORT. - // I need to check if simple-relay.mjs respects PORT env var. - // Checking existing simple-relay.mjs content... it uses const PORT = 8008; - // Wait, I saw "const PORT = 8008;" in the file content. - // I should probably edit simple-relay.mjs to accept PORT env or just use 8008. - // Let's assume 8008 for now if I can't change it easily, but wait, I can pass it via env? - // The script I read: "const PORT = 8008;" -> It does NOT use process.env.PORT. - // So I must use 8008. - // Let's restart relayProc with correct expectation if needed, or just modify the script temporarily? - // Ah, the user prompt said "Start a local relay instance". - // I'll stick to 8008. } catch (e) { log('Failed to start relay: ' + e.message, 'FATAL'); - // We can try to proceed if relay is already running? - // But let's fix the port logic. + // We attempt to proceed, as relay might be running } try {