Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

[refactor/tests] Added tests for Redis PubSub replication #453

Merged
merged 30 commits into from
Aug 14, 2020

Conversation

rennokki
Copy link
Collaborator

This PR adds some changes to the PubSub replication PR (#140) introduced by @francislavoie

Currently, the tests are set up to run for both Local and Redis clients in the same CI pipeline.

@rennokki rennokki mentioned this pull request Aug 13, 2020
14 tasks
@francislavoie
Copy link
Contributor

FWIW I called it "replication" because it's not purely pubsub due to having the channel methods in the interface. But no complaints from me, either is okay.

@rennokki
Copy link
Collaborator Author

Then I'll just revert the namings. I want something really concise. 🤔 replicator ?

@rennokki
Copy link
Collaborator Author

Just found out that tests can be done by using mocking.

https://github.com/clue/reactphp-redis/blob/master/tests/FactoryLazyClientTest.php

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2020

Codecov Report

Merging #453 into refactor/tests will increase coverage by 9.40%.
The diff coverage is 89.74%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##             refactor/tests     #453      +/-   ##
====================================================
+ Coverage             60.79%   70.19%   +9.40%     
====================================================
  Files                    53       53              
  Lines                  1311     1171     -140     
====================================================
+ Hits                    797      822      +25     
+ Misses                  514      349     -165     
Impacted Files Coverage Δ Complexity Δ
src/PubSub/Drivers/RedisClient.php 58.62% <68.75%> (+58.62%) 0.00 <0.00> (-22.00) ⬆️
src/Dashboard/DashboardLogger.php 89.36% <86.95%> (+0.72%) 0.00 <0.00> (-8.00) ⬆️
src/Console/StartWebSocketServer.php 80.19% <100.00%> (+2.17%) 0.00 <0.00> (-19.00) ⬆️
...rc/HttpApi/Controllers/FetchChannelsController.php 100.00% <100.00%> (ø) 0.00 <0.00> (-8.00)
src/PubSub/Drivers/LocalClient.php 96.29% <100.00%> (-0.26%) 0.00 <0.00> (-11.00)
src/WebSockets/Channels/Channel.php 96.07% <100.00%> (-0.54%) 0.00 <0.00> (-22.00)
src/WebSockets/Channels/PresenceChannel.php 100.00% <100.00%> (ø) 0.00 <0.00> (-9.00)
src/WebSocketsServiceProvider.php 96.42% <100.00%> (+21.80%) 0.00 <0.00> (-8.00) ⬆️
src/Console/RestartWebSocketServer.php 75.00% <0.00%> (-25.00%) 0.00% <0.00%> (-1.00%)
src/Statistics/DnsResolver.php 33.33% <0.00%> (-6.67%) 0.00% <0.00%> (-5.00%)
... and 35 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c676cb...b7a00ba. Read the comment docs.

@rennokki rennokki merged commit 942f492 into refactor/tests Aug 14, 2020
@rennokki rennokki deleted the refactor/pubsub-replication-tests branch August 14, 2020 17:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants