Skip to content

[BE-125] Unit tests for the queue module #984

Description

@mftee

Overview

backend/src/queue/ has 3 files and no tests. bullmq, @nestjs/bull, and ioredis are installed, so background processing carries real work — and a silently failing job is invisible without tests or observability.

Tasks

  • Test job producers enqueue with the expected name, payload, and options.
  • Test consumers process correctly and handle malformed payloads without crashing the worker.
  • Test retry behaviour and that a permanently failing job ends in a defined state rather than vanishing.
  • Test idempotency — the same job processed twice must not double-apply its effect.
  • Test that job payloads carry no secrets, since they persist in Redis.
  • Mock Redis rather than requiring a live instance.

Acceptance Criteria

  • npm run test -- queue passes without a running Redis.
  • A malformed payload cannot crash the worker.
  • Duplicate processing is proven safe.

Notes for Contributors

Comment below to be assigned.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions