Skip to main content
Version: 0.2.1

Descriptions and records

How a test is described, how a description is joined to its tests, and what a run records. The three are checked by one tool, yoke-verify, published from yoke.

A description​

One file per feature, <feature>.std.md, beside the tests that perform its cases, in English.

  • One H1 naming the feature, then a table of two rows: Feature, a sentence saying what it does, and Planning item, written <owner>/<repository>#<number>.
  • <feature> is kebab-case, unique within the repository, and the file's basename.

A case​

An H2 reading <identifier> — <title>, then a table of eight fields, in this order and no other.

FieldHoldsWritten
Citesthe rules the case exercisesone or more, separated by ·
Levelthe level that runs itL0, L1, L3, L4 or L5
Methodhow it shows the rule holdstest or check
Not applicable inthe environments it does not apply to—, or dimension: value pairs separated by ·
Labelwhat its failure stopsblocking, or not blocking — <owner>/<repository>#<number>
Preconditionthe state it starts fromprose
Actionwhat is doneprose
Expectedwhat must be observed for the rule to holdprose
  • Expected is something observed — a state, an output, a record, an absence that can be checked — never works correctly.
  • Cites names rules of the project's specification, which is not published. Descriptions are the one place public files cite it: the citation is what joins a case to the rule it verifies.

The identifier​

<repository>:<feature>.<nn> — for example yoke:manager-install.01.

  • It is unique across the project.
  • A number is never reused. A deleted case is struck and kept: its heading reads ## ~~<identifier> — <title>~~, with no table.
  • It stays the same when the rule it cites is renamed or moved.

Joining a case to its test​

The test performing a case carries a marker, a comment line that is nothing else: // std: <identifier>, # std: <identifier> or /* std: <identifier> */.

One case, one test; one test, one case. A case with no marker, or a marker naming no case, fails the repository's checks.

The record of a run​

Every run writes one record, as JSON.

FieldHolds
schemathe record schema's version
repository, commitwhere the run happened
level, tierthe level, and reference or complete
environmentthe value of each environment dimension the run fixed
started, finishedinstants in UTC
ranevery artifact the run involved, each with name, version and commit
statepassed, failed or not reached
blockswhether a blocking case failed or is absent
casesper case: id, result, label, the item a not blocking label cites, and detail on failure
ResultMeans
passthe test ran and the rule held
failthe test ran and the rule did not hold — or the runner reported it skipped: nothing is skipped
absentthe description declares the case and the run produced no result: a failure
not applicablethe description declares the case inapplicable here; computed from the declaration

The record is built from what the run already printed: a Go test runner's JSON output, and a check's own lines, pass <id> and FAIL <id> — <what failed>.

One run may perform several levels — yoke's test verb performs L1, L2 and L3 — and it writes one record per level. Each record takes the results of the cases declared at its level and leaves the others to their own level's record; only a result that answers no case at all is refused.

yoke-verify​

CommandDoesFails when
yoke-verify descriptions [--repository <name>] [--emit json] <root>checks every description's form, and lists its cases — or emits them as JSONa description breaks its form, or an identifier repeats
yoke-verify markers [--repository <name>] <root>pairs every case with its test, and prints the pairsa case has no test, a test has two cases, or a marker names no case
yoke-verify record --level <level> --results <file> … <root>writes the record of a run from what it left behind: --results once per output file, --started and --finished, --environment dimension=value, --ran name=version@commit, --not-reachedeither of the above, or a result it cannot join to a case

just test runs the first two, and continuous integration runs the third after the verbs. Every repository but yoke calls the published binary, which just develop puts on PATH; yoke runs the tool from its own tree, since that is the tool its tests exercise. A record names the tool by the version and the commit the binary states about itself.