Skip to content

XML: derive totals in tests from the actual state of ceridwen - #9

Merged
baughj merged 1 commit into
mainfrom
htoo-580-derived-totals
Oct 23, 2026
Merged

baughj merged 1 commit into
mainfrom
htoo-580-derived-totals

Conversation

@baughj

@baughj baughj commented Oct 23, 2026

Copy link
Copy Markdown
Member

This fixes a long-standing bug in xml where we were manually counting variants in ceridwen, which leads to, well, annoyances. This PR counts the XML files with XDocument and applies our expansion rules to get the total.

Addresses HXML-1 / HTOO-580.

- The world-load tests compared item and creature counts with fixed
  totals, 176 and 25, which ceridwen has long outgrown. They now count
  the XML with XDocument and apply the loader's expansion rules: an
  item plus one per variant in each group it names and each variant it
  names singly, and a creature plus one per subtype.
- Every other count reads subdirectories and skips .ignore paths, as
  the loader does. Maps moved into subdirectories, so the old top-level
  count expected none.
- GetTotal adds the variants, which the loader stores individually as
  well as in their groups.
- The derived count shows one item lost on every ceridwen since 2023:
  two variants without a modifier gave Variant All Belt two variants
  with the same id, and one replaced the other. 176 was the count with
  that item missing. Ceridwen's fix is separate.

Refs: HXML-1
@codecov

codecov Bot commented Oct 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.57%. Comparing base (3fac74d) to head (28304cf).

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   61.11%   61.57%   +0.45%     
==========================================
  Files          43       43              
  Lines        1538     1538              
  Branches      349      349              
==========================================
+ Hits          940      947       +7     
+ Misses        484      482       -2     
+ Partials      114      109       -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@baughj
baughj merged commit b22a19f into main Oct 23, 2026
3 checks passed
@Caeldeth
Caeldeth deleted the htoo-580-derived-totals branch October 24, 2026 20:12

This branch was previously deployed

1 inactive deployment
deploy — 28304cf5 Deployed Oct 23, 2026 by baughj via build (10.0.x) #119
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.

2 participants