Run the front page rather than read it - #12
Merged
Merged
Conversation
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
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.
22 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
quickstartitem 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 calledDatabase.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
ReadmeTesttakes 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:
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.ReadmeTestruns in theenginejob, which already runsmvn testwithZU_LIBRARYset, so no workflow changed.Two other edits on the page follow from the first. The loader example under "Getting rows in" now writes
people.zu1rather than the samesocial.zu1the 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,installandstability, which are apparatus, andapi-mapandperf, which are reports the release collects.