secator icon indicating copy to clipboard operation
secator copied to clipboard

Add tests with remote worker using Docker

Open Copilot opened this issue 1 month ago • 3 comments

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.py with 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.md with 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.yml to:

    • 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:

  1. Spin up Redis (as Celery broker and result backend)
  2. Start a secator worker container
  3. Execute tasks remotely and verify results
  4. 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.

Copilot avatar Nov 22 '25 14:11 Copilot

[!IMPORTANT]

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Nov 22 '25 14:11 coderabbitai[bot]

@copilot You were rate limited, resume your work

ocervell avatar Nov 22 '25 18:11 ocervell

@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

Copilot avatar Nov 22 '25 18:11 Copilot