Skip to content

Meta: Extend Celery/Redis integration tests (Tier 1 + Tier 2) #2400

@berendt

Description

@berendt

Context

#2368 laid the foundation for integration tests: the python-osism-integration-tests Zuul job (playbooks/test-integration.yml) starts a single redis:7-alpine container, installs the package with pipenv, and runs pytest tests/integration with REDIS_HOST=localhost and OSISM_REQUIRE_REDIS=1. The shared infrastructure — skip-when-Redis-unreachable logic plus the celery_app / celery_worker session fixtures — lives in tests/integration/conftest.py.

Three test modules exist so far:

  • test_celery.py — noop round-trip + worker visibility
  • test_locking.py — Redlock + task-lock round-trip
  • test_redis_streams.py — task-output push/finish/fetch

This meta issue tracks the next round of integration tests. The guiding principle: first exhaust everything that works with the existing single-Redis infrastructure (Tier 1), then add the few tests that need only one extra test dependency (Tier 2 — httpx for the FastAPI TestClient). Tests that require additional services (RabbitMQ, NetBox, OpenStack) are explicitly out of scope here and will be tracked separately.

All new tests live under tests/integration/, carry pytestmark = pytest.mark.integration, stay green locally (skipped without Redis), and run for real in CI.

Tier 1 — no infrastructure change (Redis only)

Tier 2 — one extra test dependency (httpx for FastAPI TestClient)

Shared prerequisite: add httpx to [dev-packages] in Pipfile so fastapi.testclient.TestClient is importable. fastapi itself is already a runtime dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions