Skip to content

Add unit test for DELETE /faults status filter verification #229

@mfaferek93

Description

@mfaferek93

Summary

The global DELETE /faults?status= endpoint lacks a test that verifies the status filter actually works (e.g. inject a confirmed fault → DELETE with ?status=pending → verify the confirmed fault still exists). Current integration tests only check that 204 is returned, because demo nodes continuously re-report faults making absence checks flaky.


Proposed solution (optional)

Add a C++ unit test (~30-50 lines) with a mock fault manager:

  1. Mock list_faults() to return known faults with different statuses
  2. Call handle_clear_all_faults_global with ?status=pending
  3. Verify clear_fault() was only called on pending faults

Existing patterns in test_fault_manager.cpp can be reused — no new test infrastructure needed.


Additional context (optional)

Raised during PR #228 review by @bburda.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions