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:
--againsttakes only a name.devis reserved for the localbynk devthe runner starts itself; anything else must be a target named under[test.targets]inbynk.toml. A bare URL is refused.- A target marked
production = trueis 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§
- Remote
Run - A remote run that passed every safety check.
Enums§
Constants§
- DEFAULT_
SETTLE_ MS --settle’s default: a failingexpectin a remote run is retried for up to five seconds (track §3.6).- DEV
- The reserved
--againstvalue that starts a localbynk dev. - DEV_
COMMAND_ ENV - Internal: the
bynkbinary that can startbynk dev, set bybynk test --against devfor thebynkcit delegates to. Without it,bynkc test --against devis refused. - DEV_
ENV_ ENV - Internal: the
envmap of the cases onebynk devserves. - DEV_
RUN_ ID_ ENV - Internal: the
run.ideverybynk devgroup of one--against devrun shares (set by the orchestration). Read only withDEV_URLS_ENV. - DEV_
SECRETS_ ENV - Internal: the secret values one
bynk devserves, by name, which the runner signs with. One JSON variable, so a name such asPATHnever 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 devorchestration). Every one must be loopback. - RUN_
ID_ ENV - The variable the remote harness reads
run.idfrom. 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.idfor 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
urlis plain HTTP on a loopback host, the only kind of URL abynk devrun accepts. - parse_
settle - Parse a
--settleduration (5s,500ms,2m,0) to milliseconds. - resolve
- Check
--against <value>for a project rooted atproject_root, against the environmentenv(by name), and resolve what it asks for.