forked from 0xWheatyz/SPARC
Add webhook integration tests covering retry logic and Slack/Discord payload format #1657
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
SPARC/webhooks.pyimplements HTTP POST delivery with retry logic and Slack/Discord-compatible payload formatting, buttests/has no test file for webhooks. This is the only non-trivial module without coverage.What to do
Create
tests/test_webhooks.pycovering:send_event()with a mock HTTP server: verify payload structure for a generic webhook URLsend_event()with a Slack-compatible URL: verifytextkey is present in payloadWEBHOOK_URLSempty: verifysend_event()is a no-op (no HTTP calls made)Acceptance criteria
pytest tests/ -vruff check tests/passes with no errorsunittest.mockorpytest-mock; no real HTTP calls are madePR #1666 has been created for this issue. Work was completed on branch and is ready for review.