Family-shared BackendConfig builders for cross-process test backends.
Two consumer-facing factories — make_default_ts_backend_config
and make_default_rust_backend_config — own the common shape
for the JS-runtime (Node, Bun) and Rust families respectively.
Per-backend factories in consumer projects compose a small
declaration against one of these and add consumer-specific env vars
via extra_env.
Defaults baked in by family:
- TS —
'memory://' (in-memory pglet), 30s startup window. - Rust — caller-supplied real Postgres URL (an in-process WASM database isn't reachable
from
tokio-postgres), 120s startup window (cargo first-build cost),
and the FUZ_TESTING_RESET_DB_ON_STARTUP=true self-wipe gate.
Both builders default port_env_var to 'PORT'. Consumers whose
binary reads a different name (e.g. zzz's ZZZ_PORT) override. Both bind
HOST to DEFAULT_TEST_BACKEND_HOST (127.0.0.1), and, given the name of
the binary's daemon-token directory env var (daemon_token_dir_env), set it
to the {dir} whose {dir}/run/daemon_token is the bootstrap's
daemon_token_path (to_daemon_token_dir).
Common across both families: /api/rpc, /api/ws, /health,
/api/account/bootstrap, cookie_name: 'fuz_session', the standard
bootstrap block keyed off default_test_* constants. Builders call
default_test_backend_paths(name) (a repo-namespaced tmpdir) internally
when the optional paths is omitted.