Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue Integration Tests with Redis Cluster #54218

Draft
wants to merge 5 commits into
base: 11.x
Choose a base branch
from

Conversation

vadimonus
Copy link

@vadimonus vadimonus commented Jan 16, 2025

Currently Laravel declares some support for Redis Cluster, but some features are not working (for example, job batches).
This PR adds Queue Integration Tests run with Redis Cluster (on both predis and phpredis). This will allow to check if new and existing features are compatible with Redis Cluster.

Some changes were made to run tests in new environment.

  • InteractsWithRedis trait extended, to provide clustered config for redis, if REDIS_CLUSTER_HOSTS_AND_PORTS env variable is passed. This is considered backward compatible change, as currently env with this name is not described anywhere.
  • InteractsWithRedis also sets RedisManager instance for application container. Without this change application in tests tries to use application configs leading to behaviour inconsistency (as config in InteractsWithRedis and in application differs). Added cache to config in InteractsWithRedis, to make configs in trait same as in app, and do not break tests, that previously used app configs. This change may be considered backward incompatible. On the other hand, behaviour of InteractsWithRedis is not described anywhere, and is intended to be used only in tests, and this change may be treated as not breaking contracts.
  • InteractsWithRedis trait added to RateLimitedWithRedisTest (unlike other tests that interacts with redis, that test missed this trait).
  • Redis cluster queue should use {default} queue name instead of queue. RedisQueueTest updated, to take queue name from config. This allow to pass right queue name when tested in cluster.
  • testBulkJobQueuedEvent is skipped with redis cluster connection (fix for bulk with cluster and unskipping test will be in separate PR, simular to Job Batches with Redis Cluster #54205)
  • redis-cluster example in docker-compose.yml to run local tests with cluster

Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@vadimonus vadimonus force-pushed the redis-cluster-queue-tests branch 16 times, most recently from 2b8753f to 22f4a84 Compare January 18, 2025 09:04
@vadimonus vadimonus marked this pull request as ready for review January 18, 2025 09:09
@vadimonus vadimonus force-pushed the redis-cluster-queue-tests branch 4 times, most recently from f6aaded to 5531f2e Compare January 18, 2025 09:51
@vadimonus vadimonus force-pushed the redis-cluster-queue-tests branch from 5531f2e to de4335b Compare January 18, 2025 10:01
@taylorotwell taylorotwell marked this pull request as draft January 19, 2025 17:37
@vadimonus
Copy link
Author

@taylorotwell returned to draft. Please, clarify, if i should update something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant