Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix(e2e): skip browser auto-install when BYTEBASE_BROWSER_CHANNEL is set
zchpeter2410a36a7efb
diff --git a/frontend/tests/e2e/README.md b/frontend/tests/e2e/README.mdindex 14bef6acbb..38cfa166da 100644--- a/frontend/tests/e2e/README.md+++ b/frontend/tests/e2e/README.md@@ -17,7 +17,9 @@ Playwright-based end-to-end tests for Bytebase. Starts a disposable Bytebase seror a `@playwright/test` version bump (which invalidates the cached browser)self-heals on the next run. Playwright browsers live in a global cache keyedto the package version, outside `node_modules`, so `pnpm i` never fetches- them. To pre-install (or fix a failed auto-install) manually:+ them. The auto-install is **skipped when `BYTEBASE_BROWSER_CHANNEL` is set**+ (see below) — that mode drives a locally installed browser and needs no+ download. To pre-install (or fix a failed auto-install) manually:```bashpnpm --dir frontend test:e2e:install # or: pnpm exec playwright install chromium```@@ -44,6 +46,7 @@ pnpm exec playwright test masking-exemption| `BYTEBASE_BIN` | No | `./bytebase-build/bytebase` | Path to pre-built binary || `BYTEBASE_STARTUP_TIMEOUT` | No | `300000` (5 min) | Server startup timeout in ms || `BYTEBASE_HEADED` | No | — | Set to `1` for headed browser |+| `BYTEBASE_BROWSER_CHANNEL` | No | — | Drive a locally installed browser channel (e.g. `chrome`) instead of the downloaded Chromium; skips the Chromium auto-install. Useful when the download is unavailable (offline). || `BYTEBASE_E2E_LICENSE` | **Yes** | — | Enterprise license JWT (see below) || `CI` | No | — | Enables CI-specific reporter |diff --git a/frontend/tests/e2e/framework/global-setup.ts b/frontend/tests/e2e/framework/global-setup.tsindex c99e833075..56da78e05f 100644--- a/frontend/tests/e2e/framework/global-setup.ts+++ b/frontend/tests/e2e/framework/global-setup.ts@@ -9,6 +9,15 @@ import { cleanupOrphans, startServer, stopServer } from "./mode-start-new-byteba// the version-matched Chromium is present before any spec launches it. This is// idempotent: a no-op with no download when the correct build is already cached.function ensureBrowser() {+ // When BYTEBASE_BROWSER_CHANNEL is set, playwright.config.ts drives a locally+ // installed browser (e.g. Chrome) instead of the downloaded Playwright+ // Chromium — a deliberate escape hatch for when the browser download is+ // unavailable (e.g. offline). Installing Chromium here would defeat that hatch+ // by forcing the very download it exists to avoid, so skip it and let the+ // channel browser handle the run. Mirrors the config's `channel` selection.+ if (process.env.BYTEBASE_BROWSER_CHANNEL) {+ return;+ }execFileSync("pnpm", ["exec", "playwright", "install", "chromium"], {stdio: "inherit",});