Pins the held-scope, precedence and empty-string arms of processor_scope - #136
Merged
Merged
Conversation
Three arms of the send-processor shape's scope choice had no test that
went red when they broke: with no :processor_scope configured, the
scope the calling process holds (put_delivery_scope/1) is the one a
send resolves in; a configured :processor_scope, static or a fun's
answer, wins over a held one; and a fun answering "" is a miss,
answered as {:error, {:invalid_value, :processor_scope, ""}} for a send
and a delayed send alike, with nothing routed or queued.
Three tests in "the scope a live session names" pin them, each
sabotage-proven against processor_scope/1 in send_handler.ex (the
mutation is named above each test). Tests only; send_handler.ex is
unchanged. No changelog fragment: changelog.d/README.md excludes test
changes with no public surface. The full gate (mix quality) ran green
on this exact tree.
Refs: sr-pby
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.
What
Three arms of
processor_scope/1(the scope a send resolves in on the send-processor shape) had no test that went red when they broke. Three tests intest/statifier_router/send_handler_test.exs, describe "the scope a live session names", now pin them::processor_scopeconfigured, the scope the calling process holds (SendHandler.put_delivery_scope/1) is the one the send resolves in.:processor_scopewins over a held scope, both as a static value and as a fun's answer.""is a miss: a send and a delayed send each answer{:error, {:invalid_value, :processor_scope, ""}}, nothing is routed and nothing is queued, even with a held scope in reach.Tests only:
lib/statifier_router/send_handler.exis unchanged, so no answer changes. No changelog fragment:changelog.d/README.mdexcludes test changes with no public surface.Sabotage
Each mutation was applied to
processor_scope/1from a copy of the file, the handler test file was run, and the file was restored byte-equal before the next check:{:ok, nil}: "with no scope configured, the scope the calling process holds applies" failed on its assertion;Gate
Full
mix qualityran green on this exact tree: format, compile with warnings as errors, isolated tests, doc links, dependencies, Credo, docs, tests (399 of 399, 98.4% coverage) and Dialyzer.Review
In-turn review: I re-read the diff against the bead's acceptance ("a held delivery scope with no :processor_scope configured is used; a configured :processor_scope wins over a held one; a fun answering "" is a miss; each sabotage-proven") and checked each test against
processor_scope/1andoverride_scope/0insend_handler.ex. The nil-config clause and the fun's nil answer read the held scope; a binary answer is used as given; any other answer,""included, is{:invalid_value, :processor_scope, value}. The existing test for an atom answer already calls that tuple "a miss", so the new test uses the same word. Each test cleans up the held scope withon_exit(&SendHandler.delete_delivery_scope/0), as the existing seam test does. The bead's description said the changelog does not name the invalid-value error. That is stale: the 0.5.0 section's lead paragraph names it, so this PR adds nothing there.Refs: sr-pby