Repository navigation
test(extension): run the release e2e on a sandboxed Playwright 1.64.1 #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,9 +12,10 @@ | |
| * as the Chrome Web Store requires) to dist/e2e/. | ||
| * | ||
| * Needs the QA account in the repo's gitignored .env (BRIDGEHOOK_TEST_EMAIL, | ||
| * BRIDGEHOOK_TEST_PASSWORD) or the environment, a Chromium (CHROMIUM_PATH, | ||
| * default /usr/bin/chromium; Google Chrome no longer loads unpacked | ||
| * extensions from the command line) and port 3456 free. Setup and teardown | ||
| * BRIDGEHOOK_TEST_PASSWORD) or the environment, a Chromium (Playwright's own, | ||
| * which `pnpm e2e` installs; CHROMIUM_PATH names another; Google Chrome no | ||
| * longer loads unpacked extensions from the command line) and port 3456 free. | ||
| * The browser runs sandboxed, so run as a normal user, not root. Setup and teardown | ||
| * revoke the QA account's devices and channels, so runs do not accumulate. | ||
| */ | ||
| import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync } from "node:fs"; | ||
|
|
@@ -96,8 +97,12 @@ const fail = (msg) => { | |
| }; | ||
| const profile = mkdtempSync(join(tmpdir(), "bh-ext-profile-")); | ||
| const launch = () => | ||
| // Playwright's full Chromium (channel "chromium": chrome-headless-shell cannot | ||
| // load extensions) unless CHROMIUM_PATH names another, always sandboxed. | ||
| chromium.launchPersistentContext(profile, { | ||
| executablePath: process.env.CHROMIUM_PATH ?? "/usr/bin/chromium", | ||
| channel: process.env.CHROMIUM_PATH ? undefined : "chromium", | ||
|
sourcery-ai[bot] marked this conversation as resolved.
Resolved
|
||
| executablePath: process.env.CHROMIUM_PATH || undefined, | ||
| chromiumSandbox: true, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium · Root-run e2e cannot launch Chromium When the e2e command runs as root in a Linux container, Disable the Chromium sandbox for root-run e2e launches. Prompt for AI agentsIn `apps/extension/e2e/release.e2e.mjs` at line 104:
**Root-run e2e cannot launch Chromium**
When the e2e command runs as root in a Linux container, `chromiumSandbox: true` makes Chromium reject the launch, so `launchPersistentContext` fails before the e2e scenarios start.
Disable the Chromium sandbox for root-run e2e launches. |
||
| headless: true, | ||
| viewport: { width: 1280, height: 800 }, | ||
| args: [`--disable-extensions-except=${EXT}`, `--load-extension=${EXT}`], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,14 +5,14 @@ | |
| "description": "BridgeHook browser extension: forward webhooks to localhost", | ||
| "devDependencies": { | ||
| "esbuild": "^0.28.2", | ||
| "playwright": "1.64.0", | ||
| "playwright": "1.64.1", | ||
| "vitest": "^5.0.3" | ||
| }, | ||
| "type": "module", | ||
| "scripts": { | ||
| "build:drain": "node scripts/build-drain.mjs", | ||
| "package": "node scripts/package.mjs", | ||
| "e2e": "node e2e/release.e2e.mjs", | ||
| "e2e": "playwright install chromium && node e2e/release.e2e.mjs", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skip the managed Chromium install when
|
||
| "test": "vitest run" | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.