refactor(modules): thread a MatchContext through the matcher engine - #379
Open
TBX3D wants to merge 1 commit into
Open
refactor(modules): thread a MatchContext through the matcher engine#379TBX3D wants to merge 1 commit into
TBX3D wants to merge 1 commit into
Conversation
checkMatchers/checkMatcher took (resp, body), so every matcher type that needs anything else (the request url, how long the round trip took, extractor output) forces another signature change through the whole engine and all of its callers. collect the per-response state into a MatchContext built once at each of the two call sites (single request and chain step) and thread that instead. no matcher behavior changes: the classic types read Resp and Body exactly as before. extraction moves above the matcher check in executeHTTPRequest. runExtractors is side-effect-free and the finding is only built on a match, so the order is behavior-preserving, and it lets a matcher read extractor values from the context. in a chain step the context carries the running variable set, so a matcher there also sees earlier steps' values.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #379 +/- ##
=======================================
Coverage ? 64.94%
=======================================
Files ? 88
Lines ? 7874
Branches ? 0
=======================================
Hits ? 5114
Misses ? 2368
Partials ? 392 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pr summary6 files changed (+63 -30)
|
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.
checkMatchers and checkMatcher take (resp, body), so a matcher type that needs anything else, the request url, how long the round trip took, extractor output, forces another signature change through 13 call sites.
collect that per-response state into a MatchContext built once at each of the two call sites, single request and chain step, and thread it instead. the classic matcher types read Resp and Body exactly as before and their tests are unmodified. extraction does move above the matcher check in executeHTTPRequest so an expression can read extractor values; runExtractors has no side effects and the finding is still only built on a match, so the order change is not observable.