Skip to content

Testing: Add tests for Kestra integration and webhooks #41

@coderabbitai

Description

@coderabbitai

Description

The recent Kestra integration (PR #37) has zero test coverage. Critical functionality is untested.

Untested Components

  1. Kestra Client (kestra_client.py)

    • Flow triggering
    • Status checking
    • Error handling
  2. Webhook Endpoints (webhooks.py)

    • Task update handling
    • Execution update handling
    • WebSocket broadcasting
  3. WebSocket Manager (websocket_manager.py)

    • Connection management
    • Broadcast functionality
    • State tracking

Required Tests

Unit Tests

# backend/tests/test_kestra_client.py
async def test_trigger_flow_success()
async def test_trigger_flow_offline()
async def test_get_execution_status()

# backend/tests/test_webhooks.py
async def test_task_update_webhook()
async def test_execution_update_webhook()
async def test_webhook_broadcasts_to_websocket()

# backend/tests/test_websocket_manager.py
async def test_connection_lifecycle()
async def test_broadcast_to_multiple_clients()
async def test_execution_status_tracking()

Integration Tests

Acceptance Criteria

  • Unit tests for KestraClient (>80% coverage)
  • Unit tests for webhook endpoints
  • Unit tests for ConnectionManager
  • Integration test for end-to-end flow
  • Mock Kestra API responses
  • Test error scenarios (timeouts, invalid data)

Location

Related Issues

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpriority-highHigh prioritytestingTesting infrastructure and test coverage

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions