Skip to content

Tests: health gating computeHealth unit and gating/bypass integration (#203 follow-up) #214

@mojoatomic

Description

@mojoatomic

Goal
Add tests to validate health gating behavior introduced in #208/#213 and tracked by #203.

Scope

  • Unit tests
    • computeHealth scoring per dimension (overall/structural/semantic)
    • Threshold comparison logic (>= vs >)
    • intentOverrides handling (e.g., refactoring floors)
    • (If kept) per-file-type thresholds application
  • Integration tests
    • Gate PASS when score >= thresholds
    • Gate FAIL when score < thresholds
    • Bypass via env (HEALTH_BYPASS)
    • Bypass via commit token from config
    • (Optional) enforce maxBypassPerPR if we keep that policy

Acceptance Criteria

  • Unit tests cover computeHealth and threshold semantics
  • Integration tests simulate CI-like runs and assert non-zero exit on FAIL
  • Bypass flows are verified (env + commit token)
  • Test docs updated in HEALTH-GATING.md (Testing section)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions