Repository navigation
test: cover the interactions handler, settings commands, server and crypto; fuzz the parser and rules - #50
Merged
Merged
Conversation
…rypto; fuzz the parser and rules - interactions_processor_test.go: signatures, malformed payloads, the snark dropdown's valid and invalid levels, service errors - settings command paths: reply_mode, snark text, every emoji subcommand, input errors versus generic errors, emoji without reaction settings - /healthz and the disabled OAuth routes; crypto key validation, short and tampered blobs, random nonces - native fuzz tests for ParseKarmaSegments and EvaluateKarmaActionWithLimits Coverage: slack 77.7% to 84.2%, crypto 68.0% to 88.0%, http 61.9% to 95.2%, parser 90.7% to 92.6%.
jordan-simonovski
force-pushed
the
test/fill-gaps
branch
from
November 14, 2026 10:00
4dc33ef to
18296de
Compare
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.
Implements
docs/backlog/16-test-gaps.md(deleted in this PR, with its index row), the last backlog item. Tests only; no production code changes.What's covered
interactions_processor_test.go, new; the handler had no tests. It goes through the same signature gate the server uses:payloadgets 400block_actionspayload, or one without the snark dropdown, gets 200 with no callabcget "Invalid snark level."commands_settings_test.go, new):reply_mode thread|channel, andsidewaysgets usagesnark 7sets it,snark abcis rejected, and a service validation error is shown with 200emoji,emoji reset,emoji workspace resetandemoji 3 :fire:reach the service with the right workspace flagInputErroris shown with the example; any other error shows only the generic retry messageemojiwithout reaction settings gets usageinternal/http:/healthzreturnsstatus: ok, and with OAuth off/slack/installand/slack/oauth/callbackreturn 503.internal/crypto:FuzzParseKarmaSegments: never panics; every segment has exactly one well-formed ID and a symbol run that is all+or only the dash characters the parser acceptsFuzzEvaluateKarmaActionWithLimits: an applied outcome moves karma by 1 to 5, and self-karma is never appliedResults
internal/slackinternal/cryptointernal/httpinternal/parserBoth fuzzers ran 30 seconds each locally, about 11.4M and 9.3M executions, with no failures. No corpus files are committed;
go testruns the seed inputs on every run.make checkpasses. No changeset.Review
/ce-code-reviewran as a lite testing review. It confirmed every bullet in the brief has an asserting test that would fail if its behaviour broke, the fuzz invariants match the parser and the rules exactly, and nothing depends on map order or timing. Applied: its one finding, the test fake's level encoding (wrong for levels of 10 and above), plus a level-10 case.