Skip to content

test(spp_drims): assert SLA coverage over the canonical priority codes only (#443) - #542

Open
gonzalesedwin1123 wants to merge 2 commits into
19.0from
fix/drims-sla-test-canonical-codes
Open

gonzalesedwin1123 wants to merge 2 commits into
19.0from
fix/drims-sla-test-canonical-codes

Conversation

@gonzalesedwin1123

Copy link
Copy Markdown
Member

Part of #443 (weekly ci-full red). Test-only; the one failure in the DRIMS Sri Lanka stack.

Cause

TestDrimsConstants.test_sla_hours_are_keyed_by_real_priority_codes collected the codes with _codes_in, which includes locally added vocabulary codes, then asserted exact equality against {routine, urgent, critical}. spp_drims_sl adds life_threatening as a local overlay code by design (ADR-016), so under the DRIMS stack the dict gained a fourth key and the assertion failed:

{'critical': 4, 'routine': 24, 'life_threatening': 24, 'urgent': 8} != {'routine': 24, 'urgent': 8, 'critical': 4}

The sibling test in the same PR (#438) already switched to _canonical_codes_in for exactly this reason; this one was not given the same treatment. The test now asserts what it means to assert: every priority spp_drims itself ships gets its own SLA.

Evidence

Stack run -i spp_drims,spp_drims_sl --test-tags /spp_drims:TestDrimsConstants: 0 failed, 0 error(s) of 9 tests (red in the 2026-09-20 weekly run).

spp_drims 19.0.4.0.4 → 19.0.4.0.5 + HISTORY. README/index.html left for CI's generator.

Noted, not changed

A Sri Lanka life-threatening request currently gets the 24-hour routine SLA: spp_drims_sl ships approval rules keyed on that code but no drims.sla.hours.life_threatening parameter. That is a production data gap in spp_drims_sl, the same "wrong answer rather than an error" class #438 fixed for urgent; filed separately.

…s only

test_sla_hours_are_keyed_by_real_priority_codes compared against every
code in the vocabulary, so installing an overlay that legitimately
extends priorities (spp_drims_sl adds life_threatening, ADR-016) made
the exact-match assertion fail on a fourth key spp_drims never claimed
to cover. Its sibling test already used _canonical_codes_in for the
same reason (#438).

Refs #443
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.91%. Comparing base (1a3c591) to head (9424f4d).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             19.0     #542   +/-   ##
=======================================
  Coverage   76.91%   76.91%           
=======================================
  Files         704      704           
  Lines       45774    45774           
=======================================
  Hits        35205    35205           
  Misses      10569    10569           
Flag Coverage Δ
spp_base_common 91.07% <ø> (ø)
spp_drims 85.49% <ø> (ø)
spp_drims_sl_demo 68.47% <ø> (ø)
spp_programs 67.58% <ø> (ø)
spp_registry 89.00% <ø> (ø)
spp_security 69.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gonzalesedwin1123

Copy link
Copy Markdown
Member Author

Full-stack evidence: DRIMS Sri Lanka ci-full dispatched on this branch (run 35565299485, at 58cb89e) vs the 2026-09-20 weekly baseline (run 35499069639).

@gonzalesedwin1123
gonzalesedwin1123 marked this pull request as ready for review September 21, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant