Add tests with remote worker using Docker
This PR adds comprehensive tests for secator's remote worker functionality using Docker containers, as requested in issue #405.
Changes Made
-
New Test Suite: Created
tests/integration/test_remote_worker.pywith 5 test methods:- Basic remote task execution with httpx
- Chain workflows with remote workers
- Chord workflows with remote workers
- Worker availability verification
- Redis broker connectivity tests
-
Documentation: Added
tests/integration/README.mdwith comprehensive documentation for all integration tests, including:- Instructions for running remote worker tests
- Prerequisites and setup requirements
- Environment variables and debugging tips
-
CI Integration: Updated
.github/workflows/tests.ymlto:- Install redis addon for remote worker support
- Run remote worker tests alongside other integration tests
Implementation Details
The tests automatically manage Docker Compose lifecycle to:
- Spin up Redis (as Celery broker and result backend)
- Start a secator worker container
- Execute tasks remotely and verify results
- Clean up containers after tests complete
The implementation gracefully handles cases where Docker Compose or redis packages are unavailable, skipping tests as appropriate.
Testing
Run the tests locally:
secator test integration --test test_remote_worker
Or run all integration tests:
secator test integration
- Fixes #405
Original prompt
This section details on the original issue you should resolve
<issue_title>test: add tests with "remote" worker</issue_title> <issue_description>Add tests with remote worker: the remote worker can be a Docker container.</issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes freelabz/secator#405
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
[!IMPORTANT]
Review skipped
Bot user detected.
To trigger a single review, invoke the
@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
Comment @coderabbitai help to get the list of available commands and usage tips.
@copilot You were rate limited, resume your work
@copilot You were rate limited, resume your work
Resumed work and completed the remote worker tests implementation. The tests use Docker Compose to spin up Redis and a secator worker container, then verify remote task execution with various Celery patterns (basic tasks, chains, and chords). Added comprehensive documentation and integrated into CI. Commits: 421a609, c00d8a4, aa94370, 0a84971