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
Open
gonzalesedwin1123 wants to merge 2 commits into
gonzalesedwin1123 wants to merge 2 commits into
Conversation
…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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Member
Author
|
Full-stack evidence: SP-MIS
|
gonzalesedwin1123
marked this pull request as ready for review
September 21, 2026 06:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_assignment—ValueError: Invalid field 'expression' in 'spp.cel.variable'. EveryTestMetricBasetest starts withif "spp.indicator" not in self.env: skipTest, andspp_metricdepends only onbase, so per-module CI always skipped them: the SP-MIS stack (which installsspp_indicator) is the first place they ever executed. Thespp.cel.variablecreate usedexpression(the field iscel_expression),label(added only byspp_studio, which is not in spp_metric's or spp_indicator's dependency closure — the CLAUDE.mdspp_hxl/spp_studiopitfall class), and omitted the requiredcel_accessor.TestMetricCategory.test_create_category—duplicate key value violates unique constraint "spp_metric_category_code_unique":spp_indicator/data/indicator_categories.xmlseedsdemographics(noupdate). The test now uses a code no data file claims.Evidence
-i spp_metric,spp_indicatoron the two classes:0 failed, 0 error(s) of 8 tests(all three were red in the 2026-09-20 weekly run).0 failed, 0 error(s) of 25 tests. All pre-commit hooks pass.spp_metric19.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 inspp_indicator/tests/(addingspp_indicatortospp_metric's depends is circular). Tracked in the #443 research follow-ups.