Skip to main content

Module remote

Module remote 

Source
Expand description

#2138 (end-to-end testing track §3.5, §3.7, §3.8): test --against, a run of the system suites against a real runtime.

This module owns the safety of that run, before any request is made:

  • --against takes only a name. dev is reserved for the local bynk dev the runner starts itself; anything else must be a target named under [test.targets] in bynk.toml. A bare URL is refused.
  • A target marked production = true is refused.
  • A target’s secrets are read only from the runner’s environment, by the names it lists, and each must be set.
  • The target and each Worker’s URL are printed before the first request (RemoteRun::banner).

Structs§

RemoteRun
A remote run that passed every safety check.

Enums§

Against
What --against asks for, once it passed the safety checks.
Refusal
Why --against was refused.

Constants§

DEFAULT_SETTLE_MS
--settle’s default: a failing expect in a remote run is retried for up to five seconds (track §3.6).
DEV
The reserved --against value that starts a local bynk dev.
DEV_COMMAND_ENV
Internal: the bynk binary that can start bynk dev, set by bynk test --against dev for the bynkc it delegates to. Without it, bynkc test --against dev is refused.
DEV_ENV_ENV
Internal: the env map of the cases one bynk dev serves.
DEV_RUN_ID_ENV
Internal: the run.id every bynk dev group of one --against dev run shares (set by the orchestration). Read only with DEV_URLS_ENV.
DEV_SECRETS_ENV
Internal: the secret values one bynk dev serves, by name, which the runner signs with. One JSON variable, so a name such as PATH never becomes a real environment variable of the runner.
DEV_URLS_ENV
Internal: the URLs of a running bynk dev, by worker, for one group’s run (set by the --against dev orchestration). Every one must be loopback.
RUN_ID_ENV
The variable the remote harness reads run.id from. The runner always sets it for a remote run, so a value exported in the shell or a CI job is overwritten, never reused: each run’s id is its own.
SECRETS_ENV
The variable the remote harness reads every secret value from, by name.

Functions§

check_target
The checks on a named target: not production, every listed secret set.
fresh_run_id
A fresh run.id for a remote run: the time in milliseconds and the process id, in hex, so two runs don’t collide on the same deployment.
is_loopback_http
Whether url is plain HTTP on a loopback host, the only kind of URL a bynk dev run accepts.
parse_settle
Parse a --settle duration (5s, 500ms, 2m, 0) to milliseconds.
resolve
Check --against <value> for a project rooted at project_root, against the environment env (by name), and resolve what it asks for.