Repository navigation
Conversation
A server for client test suites needs the same handling of client connections as the proxy: accepting them (and carrying on after running out of file descriptors), numbering them the way the log does, recording what's said, giving clients a moment to hang up when proof stops, and leaving out connections that only probed the port. That now lives in internal/clients, and the proxy keeps only the relaying. The listener also closes a client's socket once its handler returns, and the tests for all of the above moved along with it.
The proxy only checks what a client sends, not what it does with the replies. proof serve is a small nREPL server for a client's own tests to run against. On its own it behaves like nREPL 1.7.0, and gives the same replies for the same code. Each scenario makes it behave like some other server in one particular way, e.g. last-value sends only the value of the last form, like Basilisp, jank and dialtone do. Every scenario is something a server in the compatibility matrix does, or something TCP can do to the replies (writing them a byte at a time, or several at once). The tests make sure of that. proof's own checks have to give each scenario the verdicts its servers get, and all of jank's (or Basilisp's) scenarios together reproduce that server's column of the matrix. proof can't evaluate Clojure, so proof serve understands just enough of it for the snippets of profiles/clojure.toml, the code CIDER sends when it connects, and what client tests need: output, values, errors, input, interrupts and late output from futures. Interrupting an eval, closing a session with one running and errors in the middle of the code all play out the way they do on nREPL. When proof stops, it grades the requests with the client rules, just like the proxy does. The proxy and proof serve share their options, grading and command tests, and the verdict checks of the server checks' tests moved to internal/check/checktest, so the scenario tests can use them too.
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 proxy can only grade what a client sends. proof serve is for what it does with the replies: a client's tests run against it, and scenarios make it reply the way jank, Basilisp, ClojureCLR and others do where they differ from nREPL.
Scenarios are limited to things real servers (or TCP) actually do, so clients aren't asked to cope with replies nobody sends. The evaluator only knows a small Clojure subset, enough for the profile snippets, CIDER's connect code and typical client tests.