feat: add Broadcasting module tests and scaffolding#137
Open
goravel-coder wants to merge 21 commits into
Open
Conversation
- Add config/broadcasting.go with pusher, log, null drivers - Add app/facades/broadcast.go facade wrapper - Add routes/channels.go channel auth callbacks - Add app/broadcasting/events.go implementing all ShouldBroadcast* contracts - Add tests/feature/broadcast_test.go: 13 integration tests - Add mock examples: BroadcastChannel, BroadcastDispatch - Register broadcasting service provider - Wire routes.Channels() in bootstrap - Bump framework to 8b12654
added 3 commits
July 24, 2026 16:57
- Add relay service to docker-compose.yml using darknautica/relay:latest - Add docker/relay/apps.json with test credentials - Add SetupSuite/TearDownSuite to manage relay container lifecycle - Relay tests now run automatically as part of the test suite
hwbrzzl
reviewed
Jul 24, 2026
added 7 commits
July 24, 2026 17:12
Connections are already defined in config/broadcasting.go. Only switch the default driver per test, matching the redis_test.go pattern.
Split dispatch tests into LogDriver, NullDriver, and PusherDriver. Each test explicitly switches the default connection and verifies driver-specific behavior rather than relying on a single default.
Interactive browser page that connects to RelayCloud via WebSocket and subscribes to channels to verify real-time broadcasting. Served at /broadcast.html.
RelayCloud uses Bearer token auth for REST API, not Pusher HMAC. pusher-http-go and the Goravel pusher driver are incompatible. Keep log and null driver tests which work correctly.
Replace RelayCloud with Soketi (quay.io/soketi/soketi:latest) which implements full Pusher protocol including REST API with HMAC auth. Add Go WebSocket client (tests/broadcast_ws_client.go) to subscribe to channels and receive broadcast events from Soketi. Add TestPusherDriverEndToEnd which: 1. Connects to Soketi via WebSocket and subscribes to a channel 2. Switches the broadcast driver to pusher via App().Restart() 3. Dispatches an OrderShippedNow event 4. Verifies the event was received on the WebSocket Remove relay artifacts (docker/relay/).
Replace RelayCloud with Soketi (quay.io/soketi/soketi) which implements
full Pusher protocol with HMAC auth for REST API.
Merge WSClient into tests/feature/broadcast_test.go. Add 4 dedicated
WebSocket client tests:
- TestWSClientConnect: verify socket_id from connection_established
- TestWSClientPublishAndReceive: subscribe + trigger event via Pusher REST API
- TestWSClientPublishToMultipleChannels: verify multi-channel fanout
- TestWSClientPrivateChannelAuthRejected: verify auth endpoint returns error
Add soketiTrigger/soketiTriggerMulti helpers that sign requests using the
Pusher HMAC protocol and POST to Soketi's /apps/{id}/events endpoint.
Manage soketi lifecycle via TestMain (start on boot, stop on teardown).
Remove tests/broadcast_ws_client.go (merged).
Remove docker/relay/ (replaced).
hwbrzzl
reviewed
Jul 25, 2026
added 10 commits
July 25, 2026 22:47
- Move broadcasting events from app/broadcasting to app/events - Rename types to avoid collision with existing event types - Test pusher driver as default instead of null/log - Move soketi lifecycle into broadcast_test.go SetupSuite/TearDownSuite - Remove framework-internal tests (channel helpers, constants) - Remove per-test config overrides - Rename contracts import to contractsbroadcasting
…faces Cover ShouldBroadcastWithQueue, WithQueueConnection, WithDelay, WithTries/Backoff/Timeout, and WithConnections via queue consumption, delay gating, retry timing, timeout cap, and end-to-end pusher+null+log WebSocket verification.
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.
Summary
facades.Broadcast().Channel()andfacades.Broadcast().Dispatch()Why
This PR adds full test coverage for the new Broadcasting module from goravel/framework#1525. The module enables real-time event delivery through Pusher, Log, and Null drivers. Events implement the
ShouldBroadcastcontract and are dispatched through the queue system for non-blocking delivery.A RelayCloud container (
darknautica/relay:latest) runs as a docker-compose service alongside the existing test infrastructure, providing a Pusher-compatible WebSocket server for real broadcast verification.