Repository navigation
Run the page's own read after a write - #4589
Open
evanchooly wants to merge 1 commit into
Open
evanchooly wants to merge 1 commit into
evanchooly wants to merge 1 commit into
Conversation
A find directly after a write in its section (an update, or a pipeline ending in $merge or $out), with its printed result, now joins the write's scenario as its read, across section code and input/output groups. The inventory records it as a READ block, the scenario carries it as action.read, and OperatorCaseRunner runs it on both sides after the write, comparing its results instead of the filter's. The page-wide pass also marks a write after a write, keys writes by section and tab branch, and no longer counts a syntax template as a write.
This branch has not been deployed
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.
Stacked on #4588 (
audits-retire-rst). Step 4 of the parser retirement: option (c) for update results, "run the page's own read".Problem
For a write, the runner's published check compared the page's printed result against the documents the update's own filter matched afterwards. That reading comes from the legacy harness, and pages don't work that way. When a page wants to show a write's effect, it runs a read of its own and prints that. The two kinds of example failed differently:
AFTER_EARLIER_WRITE, and the write had no result. At docs e4b0c153 this covered all of the$mergeand$outexamples, which aggregate into a collection and thenfind()it, plus$currentDate's aggregation alternative.$[]'s negation example filters ongrades: {$ne: 100}and raises the grades. The documents the filter matches afterwards aren't the collection the page prints. That case is excluded.Change
expectedFor). The write must run one command and print nothing but, at most, an acknowledgement. The find gets no scenario of its own.$mergeand$outpages: aliteralincludefollowed by anio-code-block.READblock, and the scenario carries it asaction.read: {collection, filter, projection?, sort?}. Any other modifier, such aslimit, is a generation gap. The read is lowered together with the example's earlier code, so it sees the declarations made there.$sizefilter's array has been unset.$merge/$outexamples,$currentDate's aggregation alternative, and the read of the already-ownedpositional"Update with Multiple Array Matches". Unsupported examples drop from 112 to 104, and nothing else in the inventory changes.Decisions to review
$merge,$out, a pipeline update, a compound_idor a date literal. Those gaps belong to step 5 (bindings). The runner path is proven with its own fixtures:runner/readAfterUpdatepasses with a read,runner/filterAfterUpdate(the same update with no read) fails the published check as before, andrunner/readAfterUnsetshows the filter query is skipped.$[]'s negation example, which stays excluded. Its reason now says what would lift it.AFTER_EARLIER_WRITEtoo. Before, only reads did, so in input/output groups a second write ran as if the first had never happened.db.collection.updateOne( { <filter> } … )no longer counts as a write.selected-contentbranch. A write reaches its own branch and the branches nested in it, never a sibling tab, which is a separate example.positionalowner's inventory entry now shows its read, but its frozen scenario doesn't carry one.Testing
query.updatesandaggregation.stagestests: 172 tests per mapper, run under Critter first and then reflection, with 0 failures.Self-reviewed only.