mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Adds a build-time-configured transport reconnect hook so internal builds can recover the underlying transport (e.g. WARP VPN) before the relay reconnect, while OSS builds stay a pure no-op. The generic "Reconnect to relay" button is transport-agnostic; internal users behind a VPN need the transport re-established first. A build-time env var `BUZZ_BUILD_RELAY_RECONNECT_CMD` (set only in `squareup/buzz-releases`) carries a JSON config validated into a typed Rust struct at compile time, so the OSS binary ships with zero VPN knowledge. - New Tauri command `relay_reconnect_hook` runs structured fixed-argv steps plus a readiness probe, wrapped in `tokio::task::spawn_blocking`; non-fatal end-to-end so any failure falls through to `preconnect()`. - `ReconnectHookConfig` lives in one dep-free source file `include!`'d by both `build.rs` and the runtime command, so the compile-time validation and runtime parse cannot drift. - `useReconnectRelay.ts` invokes the hook before relay preconnect, guarded so a hook rejection cannot abort the reconnect. - When `BUZZ_BUILD_RELAY_RECONNECT_CMD` is unset (OSS), the command compiles to an early-return no-op. Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
82 lines
2.3 KiB
TypeScript
82 lines
2.3 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
export default defineConfig({
|
|
testDir: "./tests/e2e",
|
|
timeout: 30_000,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: 1,
|
|
reporter: [
|
|
["list"],
|
|
["html", { open: "never", outputFolder: "playwright-report" }],
|
|
],
|
|
use: {
|
|
baseURL: "http://127.0.0.1:4173",
|
|
screenshot: "only-on-failure",
|
|
trace: "on-first-retry",
|
|
video: "retain-on-failure",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "smoke",
|
|
testMatch: [
|
|
"**/smoke.spec.ts",
|
|
"**/channels.spec.ts",
|
|
"**/badge.spec.ts",
|
|
"**/channel-browser.spec.ts",
|
|
"**/messaging.spec.ts",
|
|
"**/custom-emoji.spec.ts",
|
|
"**/profile-custom-emoji-status.spec.ts",
|
|
"**/custom-emoji-screenshots.spec.ts",
|
|
"**/channel-mute-screenshots.spec.ts",
|
|
"**/channel-star-screenshots.spec.ts",
|
|
"**/channel-controls-screenshots.spec.ts",
|
|
"**/team-management-screenshots.spec.ts",
|
|
"**/active-turn-screenshots.spec.ts",
|
|
"**/profile-active-turn-screenshots.spec.ts",
|
|
"**/file-attachment.spec.ts",
|
|
"**/video-attachment.spec.ts",
|
|
"**/spoiler.spec.ts",
|
|
"**/mentions.spec.ts",
|
|
"**/relay-reconnect.spec.ts",
|
|
"**/relay-reconnect-screenshots.spec.ts",
|
|
"**/workflows.spec.ts",
|
|
"**/identity-archive.spec.ts",
|
|
"**/identity-archive-hide.spec.ts",
|
|
"**/relay-connectivity-screenshots.spec.ts",
|
|
"**/unread-pill-screenshots.spec.ts",
|
|
"**/thread-unread-screenshots.spec.ts",
|
|
"**/animated-avatar-screenshots.spec.ts",
|
|
],
|
|
use: {
|
|
...devices["Desktop Chrome"],
|
|
},
|
|
},
|
|
{
|
|
name: "integration",
|
|
testMatch: [
|
|
"**/agents.spec.ts",
|
|
"**/onboarding.spec.ts",
|
|
"**/stream.spec.ts",
|
|
"**/integration.spec.ts",
|
|
"**/profile.spec.ts",
|
|
"**/sidebar.spec.ts",
|
|
"**/tokens.spec.ts",
|
|
"**/persona-env-vars.spec.ts",
|
|
"**/mesh-compute.spec.ts",
|
|
],
|
|
use: {
|
|
...devices["Desktop Chrome"],
|
|
},
|
|
expect: {
|
|
timeout: process.env.CI ? 15_000 : 10_000,
|
|
},
|
|
},
|
|
],
|
|
webServer: {
|
|
command: "python3 -m http.server 4173 -d dist",
|
|
cwd: ".",
|
|
reuseExistingServer: !process.env.CI,
|
|
url: "http://127.0.0.1:4173",
|
|
},
|
|
});
|