Expand description
v0.59: the bynkc test --format json result model, plus the parser that
folds the runner’s NDJSON event stream into it.
The generated tests/main.ts runner emits one JSON event per line when
BYNK_TEST_FORMAT=ndjson (an internal protocol — proposal v0.59,
Decision 2); run_test captures that stream and renders the single pinned
document below. The document is built from #[derive(Serialize)] structs
in declaration order — field order is the contract (the discipline
bynk/src/report.rs calls out); we never use serde_json::json!, so the
preserve_order feature some workspace crates enable can’t reorder it.
There are three terminal states, distinguished by the consumer on the
presence/kind of error:
- normal —
suitespresent, noerror(may havefailed > 0); - compile — the project never compiled: no
suites,error.kind == "compile"carrying thebynkcdiagnostic lines; - runtime — the runner started then died before
run-end: the observedsuitesprefix anderror.kind == "runtime"with the captured stderr.
Structs§
- Case
- Coverage
- The
coverageblock: whole-run totals plus one entry per measured.bynkfile, keyed by project-relative path. Attributed to.bynksource lines, not emitted.ts/.js(issue #854); generated glue with no source origin is out-of-scope, never counted. - File
Coverage - One measured
.bynkfile’s line coverage. - Location
- Parsed
Run - The outcome of parsing the runner’s NDJSON stream: the suites observed, the
running tallies, and whether a
run-endevent was seen (a missingrun-endmeans the runner died mid-stream — a crashed/incomplete run). - Refusal
- #2272: a step of a driven history that an agent refused.
indexis the step’s position in the shrunk sequence the case reports (from 0),callthe handler it called, and the rest names the declaration that refused it, asViolationdoes. - Suite
- Test
Error - TestRun
- The pinned
bynkc test --format jsondocument. - Unmatched
- The
--suiteand--casevalues a run selected nothing for (#2273), asrun-endreports them: present only when a filter was given and a value went unmatched. A filter that selects nothing is an error, not a vacuous pass. - Violation
- #2272: the declaration a violated invariant or transition names.
kindis the declaration’s own kind,"invariant"or"transition", which the name alone cannot say (an invariant and a transition may share one).
Functions§
- parse_
ndjson - Parse the runner’s NDJSON stdout into a
ParsedRun. Unparseable or unrecognised lines are skipped (the stream is an internal protocol; a stray line should never abort the whole report).