Repository navigation
webapi-test: a run's trace — a record per move, the narrowing, label and move counts (zenbridge #2712) - #50
Merged
Merged
Conversation
… (0.1.1.0, zenbridge #2712) A run's trace shows each step's answer as received; the session kept the last answer's status and headers (#2377) but not its body. Both transports now keep the body too (`ClientsState.lastBody`), cleared with the rest by `beginStep`; `getLastResponseBody` reads it. Additive: `testClientWith` keeps its shape, `testClientRawWith` (internal) answers the body as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
…and move counts (0.2.0.0, zenbridge #2712) QuickCheck's counterexample text was the only record of a run. A `Recorder` (`Test.WebApi.Trace`, qc-dynamic) now keeps it as data: * one record per step a case played: the request as sent (fresh values filled, credentials masked, the body clipped), the answer as received (status, body, value), every check by name with whether it held and why not, the labels that held, the model after the step, the stage before and after (`appStageOf`, `noStage` for a model with none); * a line per generated case and per narrowing try (`taken` when it still failed), the first failing case and the narrowed one in full, and the label and move counts over the generated cases. The cases close through QuickCheck's own callbacks: `PostTest` after every test, narrowing tries included, `PostFinalFailure` on the narrowed case. `propDLTraced` records a property; `propDL` records nothing, as before. A step's postcondition becomes a list of named checks (`andCheck`; the script's postcondition, each `ensures`, each `refutes`) and every check runs: before, the first failure was the only one reported. `andClassify` labels a step's case through QuickCheck's `classify`. `setStep` says where a step was written (`StepInfo`: its trail, summary and operation); `EffectCall` carries one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2
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.
Zenbridge #2712 (Preflight 1) replaces QuickCheck's counterexample text with a record per move. Two commits:
webapi-session 0.1.1.0: the last answer's body. The session already kept the last answer's status and headers (#49). Both transports now keep its body as well (
ClientsState.lastBody, read withgetLastResponseBody).beginStepclears it along with the rest. The change is additive.webapi-test 0.2.0.0: a run's trace, as data (
Test.WebApi.Trace, qc-dynamic)appStageOf;noStagefor a model with none).takenwhen the try still failed), the first failing case and the narrowed one in full, and label and move counts over the generated cases.PostTestruns after every test, narrowing tries included;PostFinalFailureruns on the narrowed case.propDLTracedrecords a property.propDLrecords nothing, as before.andCheck): the script's postcondition, eachensuresand eachrefutes. Every check runs. Before, only the first failure was reported.andClassifylabels a step's case through QuickCheck'sclassify.setStep/StepInforecord where a step was written.EffectCallgains a field for it, which is a breaking change, hence the major bump.Consumers:
classifyfield,urTrace);runPlanTextreturns the trace);plan_run).Zenbridge pins all three together with this branch.
Verified:
cabal build all --keep-goingis clean;🤖 Generated with Claude Code
https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2