Skip to content

Run the front page rather than read it - #12

Merged
tamnd merged 1 commit into
mainfrom
quickstart
Aug 22, 2026
Merged

Run the front page rather than read it#12
tamnd merged 1 commit into
mainfrom
quickstart

Conversation

@tamnd

@tamnd tamnd commented Aug 22, 2026

Copy link
Copy Markdown
Owner

The quickstart item of the clients scorecard, which asks that the README's programs are run by CI as printed.

What was wrong

The first block on the page was a fragment. No class, no main, and it called Database.open("social.zu1") on a file the reader does not have. Somebody who copied it got a compile error first and a missing file second, which is the worst first impression a client can make, and nothing in this repository would ever have said so.

What it is now

A whole program. It builds the graph with a loader, because the engine has no DDL yet and that is how a table comes into being, then reads it back and prints two lines. The block that follows it on the page is what it prints.

The rule the page is read against is that a block declaring a public class is a program and a block that does not is a fragment. That is a rule rather than a list, so a block added later is picked up by being what it is.

How it is run

ReadmeTest takes the source off the page character for character, writes it into an empty directory somewhere else on the machine, and compiles and runs it in a JVM of its own through single file source mode, with the client on its class path and nothing else. No test framework reaches it, no fixture, no working directory with a database already in it. What it prints is compared against the output block, which is the half of the claim that rots quietest.

The class path that child gets is written out by the build with maven-dependency-plugin, not worked out by the test. A test that pointed at a sibling module's target directory would keep passing on the day the dependency graph changed under it.

Checked both ways

Green with the page as written, and with one word changed in the output block it fails naming the line:

ReadmeTest.lambda$everyProgramOnThePageRunsAndPrintsWhatItSays$0:77 expected: <ada follows everyone

There is also a test that fails when the page has no program on it at all, because a rule that quietly matches nothing leaves a green suite that runs nothing.

Verified

Full reactor on a Linux box against a release build of the engine: mvn -B -ntp test, BUILD SUCCESS, 40 green surefire lines across both providers, 7m22s. ReadmeTest runs in the engine job, which already runs mvn test with ZU_LIBRARY set, so no workflow changed.

Two other edits on the page follow from the first. The loader example under "Getting rows in" now writes people.zu1 rather than the same social.zu1 the quickstart builds, and the sentence in "What works today" that pointed at it now points at the quickstart.

This takes zu-java from 35 to 45 of the 90 its tier asks for. What is left is misuse, leaks, install and stability, which are apparatus, and api-map and perf, which are reports the release collects.

The quickstart was a fragment. No class, no main, and it opened a
database the reader does not have, so a person who copied it got a
compile error first and a missing file second. It is a whole program
now: it builds the graph, reads it back, and prints the two lines the
page says it prints.

The test runs it as printed. The source is taken off the README
character for character, written into an empty directory, and compiled
and run by a JVM of its own with the client on its class path and
nothing else, and what it prints is compared against the block that
follows it. A block that declares a public class is a program and a
block that does not is a fragment, which is a rule the page can be read
against rather than a list kept in the test.

Checked both ways. With the page as written the suite is green, and
with one word changed in the output block it fails naming the line.

The class path the child gets is written out by the build rather than
worked out by the test, because a test that guessed at a sibling
module's target directory would keep passing on the day the dependency
graph changed under it.
@tamnd
tamnd merged commit d48f480 into main Aug 22, 2026
9 of 17 checks passed
@tamnd
tamnd deleted the quickstart branch August 22, 2026 08:55
tamnd added a commit to tamnd/zu that referenced this pull request Aug 22, 2026
The Java client's first example was a fragment that did not compile and
opened a database the reader does not have. It is a whole program now,
and the suite runs it as printed in a JVM of its own and compares what
it prints against the block on the page.

tamnd/zu-java#12. Forty five of ninety.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant