rastrillo / fiesta Public

Test evidence: One hand-owned example document per component state, and the fixtures, seeded from rastrillo at SEED open

On branch fiesta-1

Test evidence for Task 5 of the Fiesta packaging, copied from the implementer's report so it sits on the branch.

Commits

  • f2ec990 The example package and the seed exporters, with the generated tree held for copy review
  • 1480777 One hand-owned example document per component state, and the fixtures, seeded from rastrillo at SEED
  • Fix round 1: 111e5b6 Install the seed script's trap only once the scratch worktree is its own; e304913 Hold the example file format and the layouts in tests, and cover the one-newline trim and the reversed slot; 4d02694 Seed every layout drive's pages with their own defines, and call the plain builders
  • Copy follow-up: c0004a6 Example titles and the layout note in Fiesta's words

RED: example.go as stubs returning errUnimplemented

$ go test ./example/ -count=1
--- FAIL: TestMarkupReturnsTheBodyAsWritten (0.00s)
    example_test.go:45: Markup: example: not implemented
--- FAIL: TestSlotReplacesOnlyTheSlot (0.00s)
    example_test.go:65: Slot: example: not implemented
--- FAIL: TestDefaultIsAState (0.00s)
    example_test.go:110: the embedded tree has no examples/examples.json: open examples/examples.json: file does not exist
--- FAIL: TestTheManifestMatchesTheFiles ... TestAllWalksTheManifestInOrder (same cause)
FAIL	amadan.net/rastrillo/fiesta/example	0.002s

TestMarkupRefusesAMissingState and TestSlotRefusesTwoSlots passed against the stubs, since a stub that always errors satisfies a test that wants an error. TestEveryLanguageFileHasTheShape's RED is its built-in control subtest, which fails if the checker stops catching a missing key, an empty word, an extra key or a hint without {example}.

GREEN

$ go test ./example/ -count=1 -run 'Markup|Slot' -v
--- PASS: TestMarkupReturnsTheBodyAsWritten
--- PASS: TestMarkupRefusesAMissingState
--- PASS: TestSlotReplacesOnlyTheSlot
--- PASS: TestSlotRefusesTwoSlots
ok  	amadan.net/rastrillo/fiesta/example	0.002s

$ go test ./... -count=1      (after the export and the fiesta.go embed)
ok  	amadan.net/rastrillo/fiesta	0.074s
ok  	amadan.net/rastrillo/fiesta/check	0.226s
ok  	amadan.net/rastrillo/fiesta/example	0.026s
ok  	amadan.net/rastrillo/fiesta/internal/axe	0.003s
ok  	amadan.net/rastrillo/fiesta/internal/markup	0.002s
ok  	amadan.net/rastrillo/fiesta/internal/nodetest	0.251s
$ go test ./check/ -run TestEveryLanguageFileHasTheShape -v
--- PASS: TestEveryLanguageFileHasTheShape
    --- PASS: TestEveryLanguageFileHasTheShape/control

The export runs: dry run fiesta seed dry run: 72 examples, 1 labels need copy review (state.scheme-menu.standalone), 86 fixture entries; real run wrote 199 files (72 examples) and wrote 58 fixture files. Phase B (1480777): make ci exit 0, browser.internal.harness ok 5.9s, browser.check ok 4.1s; browser spot-check of three examples over file:// rendered as expected.

Fix round 1

run.sh (Important 1, Minor 1), exercised:

$ env -u TMPDIR ./hack/seed/run.sh <checkout> <SEED>
run.sh: TMPDIR is unset; set it to scratch space on disk, not /tmp
exit=2
$ mkdir -p $TMPDIR/rastrillo-seed/marker && touch .../marker/keep && ./hack/seed/run.sh <checkout> <SEED>
run.sh: /home/paulca/.cache/tmp/rastrillo-seed already exists; another run may be using it. Remove it by hand if not.
exit=1
keep            (the marker survived)
0               (git worktree list: no rastrillo-seed added)

The layout builders are seeded (Important 2): index.json now has 137 entries, 135 with a path, 2 example references, 0 unseeded. TestEveryExampleHasTheStandardHead and TestEveryLayoutHasOneDefaultAndOneSlot each carry a control subtest that mutates a copy of a real document and expects the checker to name the fault: --- PASS: TestEveryExampleHasTheStandardHead/control, --- PASS: TestEveryLayoutHasOneDefaultAndOneSlot/control.

Verification after the reseed:

$ ./hack/seed/run.sh /home/paulca/amadan.net/rastrillo/rastrillo e14b745a…
fiesta seed: wrote 199 files under … (72 examples)
ok  	amadan.net/rastrillo/rastrillo/internal/designsystem	0.057s
fiesta seed: wrote 133 fixture files under …
ok  	amadan.net/rastrillo/rastrillo/ui	0.541s
exit=0; git worktree list shows no rastrillo-seed; $TMPDIR/rastrillo-seed gone

$ go test ./... -count=1        all six packages ok
$ make ci                       exit=0; browser.internal.harness ok 6.0s; browser.check ok 4.1s

Copy follow-up (c0004a6)

Reseed check (git diff -U0 -- examples): 163 <title> lines changed and 6 intro paragraphs, nothing else. go test ./... -count=1 all ok; make browser.check ok 232.144s.