Skip to content

test(spp_metric): create test variables with the fields spp.cel.variable has, and a category code nothing seeds (#443) - #543

Open
gonzalesedwin1123 wants to merge 2 commits into
19.0from
fix-443-metric-tests
Open

gonzalesedwin1123 wants to merge 2 commits into
19.0from
fix-443-metric-tests

Conversation

@gonzalesedwin1123

Copy link
Copy Markdown
Member

Part of #443 (weekly ci-full red). Test-only; 3 tests in the SP-MIS stack.

Causes

  • TestMetricBase.test_metric_base_default_values / test_metric_base_category_assignmentValueError: Invalid field 'expression' in 'spp.cel.variable'. Every TestMetricBase test starts with if "spp.indicator" not in self.env: skipTest, and spp_metric depends only on base, so per-module CI always skipped them: the SP-MIS stack (which installs spp_indicator) is the first place they ever executed. The spp.cel.variable create used expression (the field is cel_expression), label (added only by spp_studio, which is not in spp_metric's or spp_indicator's dependency closure — the CLAUDE.md spp_hxl/spp_studio pitfall class), and omitted the required cel_accessor.
  • TestMetricCategory.test_create_categoryduplicate key value violates unique constraint "spp_metric_category_code_unique": spp_indicator/data/indicator_categories.xml seeds demographics (noupdate). The test now uses a code no data file claims.

Evidence

  • Stack run -i spp_metric,spp_indicator on the two classes: 0 failed, 0 error(s) of 8 tests (all three were red in the 2026-09-20 weekly run).
  • Module suite: 0 failed, 0 error(s) of 25 tests. All pre-commit hooks pass.

spp_metric 19.0.2.0.0 → 19.0.2.0.1 + HISTORY. README/index.html left for CI's generator.

Noted, not changed

The spp.indicator-gated tests would run in per-module CI if they lived in spp_indicator/tests/ (adding spp_indicator to spp_metric's depends is circular). Tracked in the #443 research follow-ups.

…ble has, and a category code nothing seeds

TestMetricBase skips unless spp.indicator exists, so it had never run
before the full-stack CI. Its spp.cel.variable creates used a field
that does not exist (expression; the model has cel_expression), one
only spp_studio adds (label), and omitted the required cel_accessor.
TestMetricCategory hard-coded the code demographics, which
spp_indicator seeds, so the unique constraint refused it.

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 77.02%. Comparing base (1a3c591) to head (1723721).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             19.0     #543      +/-   ##
==========================================
+ Coverage   76.91%   77.02%   +0.11%     
==========================================
  Files         704      725      +21     
  Lines       45774    46821    +1047     
==========================================
+ Hits        35205    36062     +857     
- Misses      10569    10759     +190     
Flag Coverage Δ
spp_api_v2_gis 74.60% <ø> (ø)
spp_api_v2_simulation 71.19% <ø> (ø)
spp_base_common 91.07% <ø> (ø)
spp_dci_demo 94.28% <ø> (ø)
spp_indicator 97.67% <ø> (?)
spp_metric 100.00% <ø> (?)
spp_mis_demo_v2 70.41% <ø> (ø)
spp_programs 67.58% <ø> (ø)
spp_registry 89.00% <ø> (ø)
spp_security 69.56% <ø> (ø)
spp_simulation 79.67% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 21 files with indirect coverage changes

🚀 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: SP-MIS ci-full dispatched on this branch (run 35566151341) vs the 2026-09-20 weekly baseline (run 35499069639).

@gonzalesedwin1123
gonzalesedwin1123 marked this pull request as ready for review September 21, 2026 06:46
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