Repository navigation
webapi-test: regression cases — a narrowed case written out, replayed against the program as it is now (zenbridge #2713) - #51
Merged
Conversation
… against the program as it is now (0.3.0.0, zenbridge #2713) A failing run's narrowed case can now be kept and played first by a later run (Test.WebApi.Case, Test.WebApi.Replay): * The case is quickcheck-dynamic's own test case: its picks and steps in order. A step the program writes is kept by its kind, trail and operation, and the replay makes it again from the program. A drawn step (anyActions) is kept by its operation, the positions its generation drew (ApiGenM now keeps them) and the earlier steps its request refers to, by path (Val.varLeaves). A fresh value is never kept: it is made again, and every step that shared it shares the new one. The trace's narrowed and first_failure cases hold it as JSON. * replayTest walks the program's formula, giving each quantifier the case's next pick and checking each step against the case's next move. A case may end before the program does (narrowing cuts a test to a prefix), and the replay stops where it does. When the program no longer plays the case, it says why: a move gone or changed, a pick of another type, a drawn move the state no longer offers. replayCasesDL plays each case once, before the property draws its own, into RunTrace.replays (passed / failed at a move / cant_replay). * propDLTraced records through forAllDLRecorded: quickcheck-dynamic's generation and narrowing, with each test handed to the property. It needs runDL, which byteally's quickcheck-dynamic fork exports (4.0.1.1, pinned here; upstream input-output-hk/quickcheck-dynamic#104). * WebApiGlobalStateModel gains appRedraw (noRedraw); a drawn action is stamped with its operation (stampDrawn). 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.
This is part of Zenbridge #2713 (Preflight 2: regression cases, with exact replay). It builds on #50's trace.
webapi-test 0.3.0.0
A failing run's narrowed case can be kept and played first by a later run, against the program as it is then.
Test.WebApi.Case, format 1, JSON) is quickcheck-dynamic's own test case: its picks and steps, in order.anyActionsis kept by its operation, the positions its generation drew, and the earlier steps its request refers to, by path.narrowedandfirst_failurerecords carry the case.Test.WebApi.Replay).replayTestwalks the program's formula: each quantifier gets the case's next pick, and each step is checked against the case's next move.replayCasesDLplays each case once, before the property draws any of its own, and adds the result toRunTrace.replays: passed, failed at a move, orcant_replay.propDLTracedrecords throughforAllDLRecorded, which is quickcheck-dynamic's own generation and narrowing with each test handed to the property. That needsrunDL, which quickcheck-dynamic doesn't export. This branch pins byteally/quickcheck-dynamicbyteally-4.0.1(4.0.1.1); the upstream PR is Export runDL input-output-hk/quickcheck-dynamic#104.ApiGenMkeeps the positions it draws (runApiGenMDrawing) and can draw them again (runApiGenMRedrawing).WebApiGlobalStateModelgainsappRedraw(usenoRedrawfor a model that never draws).ValgainsvarLeavesandrepointVal, andGValRepgainsgTraverseLeaves.Verified through webapi-test-dhall's parity suite (11 tests) and Zenbridge's suites and gates. On the tbe54 sandbox:
partnerssuite's first failing case replays to the same failure. That case has 12 drawn moves and 2 position picks; each drawn move is drawn again and sent, and its links resolve to the replay's own steps.🤖 Generated with Claude Code
https://claude.ai/code/session_011wn1pGkP2oCTsWbhEafdF2