-
Notifications
You must be signed in to change notification settings - Fork 3
refactor: update AMQP connection handling to support Swoole and enhance test coverage #48
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
Conversation
…ce test coverage - Replaced php-amqplib/php-amqplib with appwrite-labs/php-amqplib in composer.json for Swoole support. - Added connection class flexibility in AMQP broker to allow using AMQPSwooleConnection. - Enhanced tests to cover both AMQPStreamConnection and AMQPSwooleConnection. - Updated various dependencies in composer.lock for compatibility and improvements.
WalkthroughThe changes introduce a new AMQPSwoole queue broker implementation with associated end-to-end tests and a worker script for Swoole-based asynchronous message processing. Visibility of certain properties and methods in the AMQP class is updated to support extension. Docker Compose is modified to add an Changes
Sequence Diagram(s)sequenceDiagram
participant Test as AMQPSwooleTest
participant Publisher as AMQPSwoole
participant AMQPServer as AMQP/Swoole Server
Test->>Publisher: Enqueue message(s)
Publisher->>AMQPServer: Publish to exchange (with retry on failure)
AMQPServer-->>Publisher: Ack/Nack
Note over Test,AMQPServer: Tests run in Swoole coroutines for concurrency and retry scenarios
sequenceDiagram
participant WorkerScript as worker.php
participant Broker as AMQPSwoole
participant Adapter as Swoole Adapter
participant Server as Queue Server
WorkerScript->>Broker: Initialize AMQPSwoole broker
WorkerScript->>Adapter: Wrap broker with Swoole adapter (concurrency=12)
WorkerScript->>Server: Create server with adapter
Server->>WorkerScript: Register job, error, and start handlers
WorkerScript->>Server: Start server (process jobs)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
composer.lock
is excluded by!**/*.lock
📒 Files selected for processing (4)
composer.json
(2 hunks)src/Queue/Broker/AMQP.php
(3 hunks)tests/Queue/E2E/Adapter/AMQPTest.php
(1 hunks)tests/Queue/E2E/Adapter/Base.php
(0 hunks)
💤 Files with no reviewable changes (1)
- tests/Queue/E2E/Adapter/Base.php
🧰 Additional context used
🪛 GitHub Actions: Linter
src/Queue/Broker/AMQP.php
[error] 1-1: Laravel Pint linting failed: PSR 12 style issue 'no_unused_imports' detected.
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Adapter Tests (Swoole)
- GitHub Check: Adapter Tests (Workerman)
- GitHub Check: Adapter Tests (SwooleRedisCluster)
- GitHub Check: Adapter Tests (AMQP)
- GitHub Check: Adapter Tests (Pool)
🔇 Additional comments (3)
src/Queue/Broker/AMQP.php (2)
49-54
: Well-implemented connection class parameter.Good implementation with backward compatibility preserved through the default value and proper validation of the connection class inheritance.
194-203
: Dynamic connection instantiation looks good.The implementation correctly uses the dynamic class instantiation with proper parameter passing.
tests/Queue/E2E/Adapter/AMQPTest.php (1)
15-33
: Well-structured test setup with proper Swoole extension checks.Good use of data providers to test both connection types and appropriate test skipping when Swoole is unavailable.
…RabbitMQ - Added start_period to healthcheck for Redis cluster services to ensure proper startup timing. - Updated RabbitMQ service healthcheck to include start_period for improved reliability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
docker-compose.yml (3)
80-80
: Use meaningfulstart_period
for Redis cluster healthchecksExplicitly setting
start_period: 0s
is effectively a no-op (the default is 0). This could lead to premature health check failures if the cluster nodes need time to start. Consider removing these entries or configuring a non-zero period (e.g.,start_period: 30s
) to allow Redis cluster nodes sufficient initialization time before health checks begin.Also applies to: 91-91, 101-101, 113-113
123-124
: Reevaluate RabbitMQ healthcheck timingThe newly added
start_interval: 1s
andstart_period: 0s
for theamqp
service may cause false negatives if RabbitMQ requires a warm-up period. If startup latency is non-trivial, bumpstart_period
to a suitable duration (for example,start_period: 30s
) to prevent the container from being marked unhealthy prematurely.
124-124
: Add newline at end of fileYAMLLint reports a missing newline at EOF. Please add a trailing newline to satisfy the linter.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docker-compose.yml
(5 hunks)src/Queue/Broker/AMQP.php
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/Queue/Broker/AMQP.php
🧰 Additional context used
🪛 YAMLlint (1.37.1)
docker-compose.yml
[error] 124-124: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Adapter Tests (Workerman)
- GitHub Check: Adapter Tests (SwooleRedisCluster)
- GitHub Check: Adapter Tests (AMQP)
- GitHub Check: Adapter Tests (Swoole)
…structure - Introduced a private property for connection class in AMQPTest to streamline publisher retrieval. - Updated test methods to use the connection class directly, improving clarity and maintainability. - Renamed test methods for better readability and consistency. - Consolidated publisher retrieval logic into the Base class for reuse across tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/Queue/E2E/Adapter/AMQPTest.php (1)
30-32
: Remove redundant Swoole extension check from getPublisher.This Swoole extension check in
getPublisher()
is redundant since the concurrency test method (testConcurrencyWithConnection
) already has a more appropriate check that only skips when the connection is notAMQPSwooleConnection
.- if ($this->connectionClass === AMQPSwooleConnection::class && !extension_loaded('swoole')) { - $this->markTestSkipped('Swoole extension is not available'); - }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
tests/Queue/E2E/Adapter/AMQPTest.php
(1 hunks)tests/Queue/E2E/Adapter/Base.php
(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Linter
tests/Queue/E2E/Adapter/AMQPTest.php
[error] 1-1: PSR 12 linting failed: no_unused_imports and single_line_after_imports style issues detected.
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Adapter Tests (Pool)
- GitHub Check: Adapter Tests (Workerman)
- GitHub Check: Adapter Tests (Swoole)
- GitHub Check: Adapter Tests (SwooleRedisCluster)
🔇 Additional comments (4)
tests/Queue/E2E/Adapter/Base.php (1)
77-79
: LGTM! Prevents runtime errors when Swoole is unavailable.The Swoole extension check is necessary since the concurrency test uses
run()
andgo()
functions from Swoole. This prevents runtime errors when the extension is not loaded.Note: There's a slight inconsistency with the approach in
AMQPTest.php
where the check is more granular (only for AMQPSwooleConnection), but this blanket approach is safer for the base class.tests/Queue/E2E/Adapter/AMQPTest.php (3)
17-23
: Well-structured data provider for testing multiple connection types.The data provider correctly provides both
AMQPStreamConnection
andAMQPSwooleConnection
classes for comprehensive testing coverage.
58-60
: Excellent granular control for concurrency testing.This implementation correctly restricts concurrency testing to only
AMQPSwooleConnection
, which is more precise than the blanket Swoole extension check. This addresses the past review feedback effectively by allowing other connection types to run without Swoole.
71-74
: Good workaround for data provider limitations with test dependencies.The manual invocation of dependent tests is a valid approach since PHPUnit's
@depends
annotation doesn't work with data providers. The comment clearly explains this limitation.
…ss and adding debug output - Commented out the AMQPSwooleConnection in the connection class array to streamline test configuration. - Added a debug output statement in the testEventsWithConnection method for troubleshooting purposes. - Removed the Swoole extension check from the testConcurrency method to avoid unnecessary test skips.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
tests/Queue/E2E/Adapter/AMQPTest.php (1)
11-11
: Remove unused import causing linting failure.This import was flagged in a previous review and is still causing linting failures. The concurrency logic is handled in the parent
Base
class.-use function Co\run;
🧹 Nitpick comments (1)
tests/Queue/E2E/Adapter/AMQPTest.php (1)
28-35
: Consider improving the method design pattern.The functionality is correct, but relying on instance variables creates tight coupling. Consider if the connection class could be passed as a parameter instead of using instance state.
Alternative approach:
-protected function getPublisher(): Publisher +protected function getPublisher(string $connectionClass = AMQPStreamConnection::class): Publisher { - if ($this->connectionClass === AMQPSwooleConnection::class && !extension_loaded('swoole')) { + if ($connectionClass === AMQPSwooleConnection::class && !extension_loaded('swoole')) { $this->markTestSkipped('Swoole extension is not available'); } - return new AMQP(host: 'amqp', port: 5672, user: 'amqp', password: 'amqp', connectionClass: $this->connectionClass); + return new AMQP(host: 'amqp', port: 5672, user: 'amqp', password: 'amqp', connectionClass: $connectionClass); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/Queue/E2E/Adapter/AMQPTest.php
(1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Linter
tests/Queue/E2E/Adapter/AMQPTest.php
[error] 1-1: PSR 12 linting failed: no_unused_imports and single_line_after_imports style issues detected.
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Adapter Tests (Pool)
- GitHub Check: Adapter Tests (Workerman)
- GitHub Check: Adapter Tests (SwooleRedisCluster)
- GitHub Check: Adapter Tests (Swoole)
- GitHub Check: Adapter Tests (AMQP)
🔇 Additional comments (2)
tests/Queue/E2E/Adapter/AMQPTest.php (2)
17-23
: Data provider structure is well-implemented.Good use of data provider pattern for testing multiple connection types. The commented-out AMQPSwooleConnection suggests a phased approach to testing, which is reasonable.
69-76
: Well-handled PHPUnit data provider limitation.Good documentation and proper workaround for the limitation that
@depends
annotation doesn't work with data providers. The manual dependency handling is the correct approach here.
tests/Queue/E2E/Adapter/AMQPTest.php
Outdated
public function testConcurrencyWithConnection(string $connectionClass): void | ||
{ | ||
$this->connectionClass = $connectionClass; | ||
|
||
if ($this->connectionClass !== AMQPSwooleConnection::class) { | ||
$this->markTestSkipped('Concurrency test can only be run with Swoole'); | ||
} | ||
|
||
parent::testConcurrency(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Address logical inconsistency in concurrency test.
The test always skips because AMQPSwooleConnection
is commented out in the data provider (line 21), making this test effectively disabled. Consider either:
- Enabling
AMQPSwooleConnection
in the data provider, or - Adding a condition to only run this test when the connection supports concurrency
🤖 Prompt for AI Agents
In tests/Queue/E2E/Adapter/AMQPTest.php around lines 55 to 64, the concurrency
test is always skipped because AMQPSwooleConnection is commented out in the data
provider at line 21. To fix this, either uncomment and enable
AMQPSwooleConnection in the data provider so the test runs with a compatible
connection, or modify the test to conditionally run only when the connection
supports concurrency by adding appropriate checks before skipping.
- Replaced appwrite-labs/php-amqplib with appwrite/php-amqplib version 0.1.0 in composer.json and composer.lock for improved stability. - Changed visibility of properties and methods in the AMQP class from private to protected to enhance extensibility. - Removed unused connection class references and streamlined the AMQPTest class for better clarity and maintainability.
- Removed unnecessary whitespace in the AMQPSwoole class to improve code readability. - Ensured consistent formatting by adding a newline at the end of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Queue/Broker/AMQPSwoole.php (1)
27-27
: Consider making locale configurable instead of hardcoding.The locale is hardcoded as 'en_US', which may not be suitable for international deployments. Consider making this configurable through a class property or method parameter.
- 'en_US', // locale + $this->locale ?? 'en_US', // localeYou would also need to add a
$locale
property to the parent class or make it configurable during construction.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
composer.lock
is excluded by!**/*.lock
📒 Files selected for processing (3)
composer.json
(1 hunks)src/Queue/Broker/AMQP.php
(2 hunks)src/Queue/Broker/AMQPSwoole.php
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- composer.json
- src/Queue/Broker/AMQP.php
🔇 Additional comments (3)
src/Queue/Broker/AMQPSwoole.php (3)
8-63
: LGTM! Well-structured Swoole integration with proper error handling.The class implementation follows good practices:
- Proper inheritance and method overriding
- Clean separation of connection creation logic
- Appropriate use of configuration hooks
- Reasonable retry mechanism for transient failures
- Good documentation and code organization
The integration appears well-designed for Swoole environments while maintaining compatibility with the existing AMQP broker interface.
18-34
: ```shell
#!/bin/bashLocate the AMQPSwooleConnection class file
FILE=$(rg --files-with-matches "class AMQPSwooleConnection" | head -n1)
echo "Found class definition in: $FILE"Display the constructor signature with context
grep -R -n -C 3 "function __construct" "$FILE"
--- `53-61`: ```shell #!/bin/bash # Locate the AMQPSwooleConnection class file file=$(rg --files-with-matches -e "class AMQPSwooleConnection" -t php) echo "Found file: $file" # Display the first 200 lines to inspect for cleanup logic sed -n '1,200p' "$file" # Search specifically for destructor and close methods rg -n "function __destruct" "$file" rg -n "function close" "$file"
- Replaced appwrite/php-amqplib with appwrite-labs/php-amqplib in composer.json for better compatibility. - Added amqp-swoole service to docker-compose.yml for improved testing capabilities. - Updated phpunit.xml to enable process isolation and stop on failure for more robust test execution.
- Simplified test methods by removing redundant go function declarations and utilizing the publisher directly. - Added retry logic in the testRetry method for enhanced testing of message retries. - Ensured consistent formatting by adding a newline at the end of the worker.php file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (1)
docs/AMQPSwoole.md (1)
11-13
: Specify language for fenced code block.Add language specification to the error message code block for better syntax highlighting.
-``` +```text Fatal error: Uncaught Swoole\Error: API must be called in the coroutine</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between d46c4f2ecf1999da6a2027044d2fcd8a7252f67e and 12808fdf46fea7c6349bb48f49b9cc12ee22fb43. </details> <details> <summary>📒 Files selected for processing (7)</summary> * `composer.json` (1 hunks) * `docker-compose.yml` (7 hunks) * `docs/AMQPSwoole.md` (1 hunks) * `phpunit.xml` (1 hunks) * `tests/Queue/E2E/Adapter/AMQPSwooleTest.php` (1 hunks) * `tests/Queue/servers/AMQPSwoole/Dockerfile` (1 hunks) * `tests/Queue/servers/AMQPSwoole/worker.php` (1 hunks) </details> <details> <summary>✅ Files skipped from review due to trivial changes (2)</summary> * phpunit.xml * tests/Queue/servers/AMQPSwoole/Dockerfile </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary> * composer.json </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 GitHub Actions: Linter</summary> <details> <summary>tests/Queue/servers/AMQPSwoole/worker.php</summary> [error] 1-1: Laravel Pint PSR-12 style check failed: no_trailing_whitespace and single blank line issues detected. </details> <details> <summary>tests/Queue/E2E/Adapter/AMQPSwooleTest.php</summary> [error] 1-1: Laravel Pint PSR-12 style check failed: no_trailing_whitespace and single blank line issues detected. </details> </details> <details> <summary>🪛 YAMLlint (1.37.1)</summary> <details> <summary>docker-compose.yml</summary> [error] 137-137: no new line character at the end of file (new-line-at-end-of-file) </details> </details> <details> <summary>🪛 LanguageTool</summary> <details> <summary>docs/AMQPSwoole.md</summary> [uncategorized] ~79-~79: Loose punctuation mark. Context: ...ters as the base `AMQP` class: - `host`: RabbitMQ server hostname - `port`: Rabb... (UNLIKELY_OPENING_PUNCTUATION) --- [style] ~114-~114: ‘exactly the same’ might be wordy. Consider a shorter alternative. Context: ... $password); ``` All other APIs remain exactly the same. (EN_WORDINESS_PREMIUM_EXACTLY_THE_SAME) </details> </details> <details> <summary>🪛 markdownlint-cli2 (0.17.2)</summary> <details> <summary>docs/AMQPSwoole.md</summary> 11-11: Fenced code blocks should have a language specified null (MD040, fenced-code-language) </details> </details> </details> <details> <summary>⏰ Context from checks skipped due to timeout of 90000ms (4)</summary> * GitHub Check: Adapter Tests (Workerman) * GitHub Check: Adapter Tests (Pool) * GitHub Check: Adapter Tests (Swoole) * GitHub Check: Adapter Tests (SwooleRedisCluster) </details> <details> <summary>🔇 Additional comments (3)</summary><blockquote> <details> <summary>docker-compose.yml (1)</summary> `48-58`: **LGTM! Well-structured service configuration.** The new `amqp-swoole` service follows the established patterns and properly depends on the AMQP service health check. </details> <details> <summary>docs/AMQPSwoole.md (1)</summary> `1-114`: **Excellent comprehensive documentation.** The documentation clearly explains the motivation for AMQPSwoole, provides practical examples, and includes a complete migration guide. This will be very helpful for users adopting the new broker. </details> <details> <summary>tests/Queue/E2E/Adapter/AMQPSwooleTest.php (1)</summary> `26-43`: **LGTM! Proper Swoole coroutine integration.** The test correctly uses `Co\run` and `go` constructs to execute within Swoole coroutines, which is essential for testing the AMQPSwoole broker functionality. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
…umentation - Changed the build path for the amqp-swoole service in docker-compose.yml to reflect the new directory structure. - Deleted the AMQPSwoole.md documentation file as it is no longer needed. - Added exchange declaration in the AMQP class to ensure proper message routing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
docker-compose.yml (1)
137-137
: Ensure newline at end of file
Add a trailing newline to satisfy YAML formatting requirements and avoid linter errors.
🧹 Nitpick comments (1)
docker-compose.yml (1)
93-93
: DRY up repetitive healthcheck blocks
Each Redis cluster node and theamqp
service repeats the samestart_period: 0s
(alongsidestart_interval: 1s
). Consider defining a reusable YAML anchor (e.g.x-healthcheck
) for common parameters to reduce duplication.Also applies to: 104-104, 115-115, 126-126, 137-137
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docker-compose.yml
(7 hunks)src/Queue/Broker/AMQP.php
(3 hunks)tests/Queue/E2E/Adapter/AMQPSwooleTest.php
(1 hunks)tests/Queue/servers/AMQPSwoole/worker.php
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- tests/Queue/servers/AMQPSwoole/worker.php
🚧 Files skipped from review as they are similar to previous changes (2)
- src/Queue/Broker/AMQP.php
- tests/Queue/E2E/Adapter/AMQPSwooleTest.php
🧰 Additional context used
🪛 YAMLlint (1.37.1)
docker-compose.yml
[error] 137-137: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Adapter Tests (Swoole)
- GitHub Check: Adapter Tests (AMQP)
- GitHub Check: Adapter Tests (SwooleRedisCluster)
- GitHub Check: Adapter Tests (Pool)
🔇 Additional comments (2)
docker-compose.yml (2)
8-8
: Mount phpunit configuration into test container
The new./phpunit.xml:/usr/local/src/phpunit.xml
volume ensures PHPUnit picks up the custom config (process isolation, stop-on-failure) correctly.
12-12
: Include AMQPSwoole as a test dependency
Addingamqp-swoole
to thetests.depends_on
list guarantees that the Swoole-based broker is up before running tests.
amqp-swoole: | ||
container_name: amqp-swoole | ||
build: ./tests/Queue/servers/AMQP/. | ||
command: php /usr/src/code/tests/Queue/servers/AMQPSwoole/worker.php | ||
volumes: | ||
- ./src:/usr/local/src/src | ||
- ./tests:/usr/local/src/tests | ||
depends_on: | ||
amqp: | ||
condition: service_healthy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix build context for amqp-swoole service
The amqp-swoole
service currently builds from the AMQP directory but runs the Swoole worker. This will produce an incorrect image.
Apply this diff to correct the build context:
- amqp-swoole:
- container_name: amqp-swoole
- build: ./tests/Queue/servers/AMQP/.
+ amqp-swoole:
+ container_name: amqp-swoole
+ build: ./tests/Queue/servers/AMQPSwoole/.
command: php /usr/src/code/tests/Queue/servers/AMQPSwoole/worker.php
volumes:
- ./src:/usr/local/src/src
- ./tests:/usr/local/src/tests
depends_on:
amqp:
condition: service_healthy
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
amqp-swoole: | |
container_name: amqp-swoole | |
build: ./tests/Queue/servers/AMQP/. | |
command: php /usr/src/code/tests/Queue/servers/AMQPSwoole/worker.php | |
volumes: | |
- ./src:/usr/local/src/src | |
- ./tests:/usr/local/src/tests | |
depends_on: | |
amqp: | |
condition: service_healthy | |
amqp-swoole: | |
container_name: amqp-swoole | |
build: ./tests/Queue/servers/AMQPSwoole/. | |
command: php /usr/src/code/tests/Queue/servers/AMQPSwoole/worker.php | |
volumes: | |
- ./src:/usr/local/src/src | |
- ./tests:/usr/local/src/tests | |
depends_on: | |
amqp: | |
condition: service_healthy |
🤖 Prompt for AI Agents
In docker-compose.yml around lines 48 to 57, the amqp-swoole service's build
context is incorrectly set to the AMQP directory, which does not match the
Swoole worker it runs. Update the build path to point to the AMQPSwoole
directory to ensure the correct image is built for the Swoole worker.
- Removed phpunit.xml from docker-compose volumes to streamline configuration. - Disabled process isolation and stop on failure in phpunit.xml for improved test execution. - Commented out unused tearDown method in AMQPSwooleTest to enhance code clarity.
- Changed the version constraint for appwrite-labs/php-amqplib in composer.json to allow for minor updates. - Updated composer.lock to reflect the new version 0.1.1 of appwrite-labs/php-amqplib. - Removed unnecessary exchange declaration code in the AMQP class to streamline message publishing.
Summary by CodeRabbit