testing/cross_backend/backend_config.ts

Cross-process backend configuration.

BackendConfig describes a spawnable test binary — argv, mount paths, env vars, bootstrap credentials, daemon-token discovery path, declared capabilities. Consumer projects ship per-backend factories (deno_backend_config(), rust_backend_config(), spine_stub_backend_config()) that produce this shape; spawn_backend consumes it.

fuz_app ships spine_stub_backend_config() as a convenience preset (operational dep on testing_spine_stub — path-based discovery, no package.json coupling to private_fuz). Otherwise backend-specific knowledge (binary paths, port choices, env vars) is a consumer concern; fuz_app's testing library knows nothing about Deno, Cargo, or any specific runtime beyond that preset.

Declarations
#

2 declarations

view source

BackendBootstrapConfig
#

testing/cross_backend/backend_config.ts view source

BackendBootstrapConfig

Auth-bootstrap configuration for a spawnable test binary. The runner writes token to token_path before launching the child, then POSTs bootstrap_path (default /api/account/bootstrap) with the token plus the username / password to mint the keeper account and capture the session cookie. After health-probe, the runner reads daemon_token_path to load the binary's deterministic daemon token, which default_cross_process_setup threads onto the per-test TestFixture for _testing_reset calls and other keeper-credential operations.

token_path

Path the binary reads for the bootstrap token (env: *_BOOTSTRAP_TOKEN_PATH).

type string
readonly

token

Token text written to token_path before spawn.

type string
readonly

username

Username for the bootstrapped keeper.

type string
readonly

password

Password for the bootstrapped keeper.

type string
readonly

daemon_token_path

Path the test binary writes its daemon-token JSON to on boot (env: *_DAEMON_TOKEN_PATH). spawn_backend reads this file once after the health probe succeeds and threads the token onto BackendHandle.daemon_token for _testing_reset calls plus any other admin/keeper-gated cross-process tests.

type string
readonly

BackendConfig
#

testing/cross_backend/backend_config.ts view source

BackendConfig

Configuration for one spawnable test backend. Consumer factories (deno_backend_config(), rust_backend_config()) produce these and the runner consumes them through spawn_backend.

Path defaults match the standard fuz_app surface — Deno + Rust spine (zzz_server, zap_server, testing_spine_stub) all converge on /api/account/{bootstrap,login,logout,password}, /api/rpc, /api/ws, /health. Override only when a backend deliberately diverges (which it shouldn't, per the contract).

name

Diagnostic label ("deno", "rust", "spine_stub"). Surfaces in test output.

type string
readonly

start_command

argv passed to the spawn. The first entry is the binary path.

type ReadonlyArray<string>
readonly

base_url

Base URL for HTTP requests, including port (e.g. http://localhost:8788).

type string
readonly

rpc_path

JSON-RPC endpoint mount point. Default /api/rpc.

type string
readonly

ws_path

WebSocket endpoint mount point. Default /api/ws.

type string
readonly

health_path

Readiness probe path. Default /health.

type string
readonly

bootstrap_path

Bootstrap POST path. Default /api/account/bootstrap.

type string
readonly

cookie_name

Session cookie name the backend issues. Default fuz_session per the ecosystem convergence; consumers using a custom session name (legacy zzz_session, etc.) override. default_cross_process_setup extracts the per-account session value from the transport jar by this name so the cross-process TestAccount.session_cookie matches the in-process shape.

type string
readonly

startup_timeout_ms

How long to wait for the health probe (ms) before giving up.

type number
readonly

env

Env vars merged into the child process. Must include the binary's *_BOOTSTRAP_TOKEN_PATH + *_DAEMON_TOKEN_PATH env var names so the binary reads/writes the right files. Also must include the binary's *_ALLOWED_ORIGINS (typically 'http://localhost:*' for cross-process tests).

type Readonly<Record<string, string>>
readonly

bootstrap

Auth bootstrap details — see BackendBootstrapConfig.

readonly

capabilities

Capabilities this backend supports — drives test_if(capabilities.X, ...) gating in suite bodies. See capabilities.ts for the vocabulary and existing flags. Cross-process backends set in_process_only: false.

readonly

Depends on
#