{"record":{"id":"40466d4c28b6bac8","repo":"santifer/career-ops","slug":"archive-render-skipped-no-playwright-browser-in-env","errorCode":null,"errorMessage":"archive render skipped — no Playwright browser in env","messagePattern":"archive render skipped — no Playwright browser in env","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"test-all.mjs","lineNumber":7122,"sourceCode":"  : fail('no --report: filename shape regressed');\n\nrun(NODE, ['archive-posting.mjs', '--dry-run', '--report=abc', 'https://boards.greenhouse.io/openai/jobs/123']) === null\n  ? pass('--report with non-numeric value: exits non-zero')\n  : fail('--report with non-numeric value: should be rejected, not ignored');\n\nrun(NODE, ['archive-posting.mjs', '--pipeline', '--report=42']) === null\n  ? pass('--report with --pipeline: rejected (report keys one posting)')\n  : fail('--report with --pipeline: should exit non-zero');\n\n// live render: gated behind Playwright executable availability\nlet hasBrowser = false;\ntry {\n  const { chromium } = await import('playwright');\n  hasBrowser = existsSync(chromium.executablePath());\n} catch { /* playwright not installed */ }\n\nif (!hasBrowser) {\n  warn('archive render skipped — no Playwright browser in env');\n} else {\n  let liveJobUrl = null;\n  try {\n    const res = await fetch('https://boards-api.greenhouse.io/v1/boards/anthropic/jobs?content=false');\n    const { jobs } = await res.json();\n    const candidate = jobs?.[0]?.absolute_url ?? null;\n    if (candidate) {\n      const u = new URL(candidate);\n      const allowed = new Set(['boards.greenhouse.io', 'job-boards.greenhouse.io']);\n      if (u.protocol === 'https:' && allowed.has(u.hostname)) liveJobUrl = candidate;\n    }\n  } catch { /* offline — degrade gracefully */ }\n\n  if (!liveJobUrl) {\n    warn('archive render skipped — Greenhouse API unreachable');\n  } else {\n    const JDS_DIR = join(ROOT, 'jds');\n    const startedAt = Date.now();","sourceCodeStart":7104,"sourceCodeEnd":7140,"githubUrl":"https://github.com/santifer/career-ops/blob/e7abd431fce9348a95261acac9e0c14779c35df8/test-all.mjs#L7104-L7140","documentation":"The archive-render test needs a Playwright Chromium browser; it checks `existsSync(chromium.executablePath())` after importing playwright. When either the import fails or the browser binary is absent, it warns that the archive render test is skipped instead of failing.","triggerScenarios":"`import('playwright')` rejects (package not installed), or playwright is installed but `chromium.executablePath()` points to a non-existent path (browsers never downloaded via `npx playwright install`).","commonSituations":"Fresh CI containers that installed the playwright npm package but skipped `playwright install`, machines where browsers were cleaned from the cache (~/Library/Caches/ms-playwright), or a Playwright version upgrade that expects a different browser build.","solutions":["Run `npx playwright install chromium` to download the browser binary.","If the npm package itself is missing, run `npm install` first, then the browser install.","In CI, cache the browsers directory and run playwright install as a setup step.","Accept the skip for local runs where you never exercise archive rendering."],"exampleFix":"// before\n- run: npm test\n// after\n- run: npx playwright install chromium\n- run: npm test","handlingStrategy":"fallback","validationCode":"let ok = false; try { const { chromium } = await import('playwright'); ok = existsSync(chromium.executablePath()); } catch {} if (!ok) console.warn('run: npx playwright install chromium');","typeGuard":"const browserReady = async () => { try { const { chromium } = await import('playwright'); return existsSync(chromium.executablePath()); } catch { return false; } };","tryCatchPattern":"try { const { chromium } = await import('playwright'); if (!existsSync(chromium.executablePath())) throw new Error('browser missing'); } catch { warn('skipping render test — install browsers with npx playwright install'); }","preventionTips":["Run `npx playwright install chromium` in postinstall or CI setup","Cache the Playwright browsers directory in CI","Re-run the install after upgrading the playwright package","Check executablePath() existence, not just package presence"],"tags":["playwright","browser","environment","test-runner"],"backgroundTag":"missing-optional-dependency","analyzedSha":"e7abd431fce9348a95261acac9e0c14779c35df8","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}