Skip to content

fix: correct off-by-one header/row assertions in ENROLLMENT_OU e2e test (2.43)#24506

Merged
jason-p-pickering merged 1 commit into
2.43from
fix/te-enrollmentou-header-test-offbyone-2.43
Jul 20, 2026
Merged

fix: correct off-by-one header/row assertions in ENROLLMENT_OU e2e test (2.43)#24506
jason-p-pickering merged 1 commit into
2.43from
fix/te-enrollmentou-header-test-offbyone-2.43

Conversation

@jason-p-pickering

Copy link
Copy Markdown
Contributor

Summary

  • TrackedEntityQueryTest.queryWithProgramAndFilterByEnrollmentOuKeyword asserted 16 headers/row-columns for dimension=<program>.ENROLLMENT_OU:<ou>, one short of the 17 its sibling queryWithProgramAndFilterByEnrollmentOrgUnit correctly asserts for the equivalent .ou dimension.
  • 2.43's TrackedEntityStaticField includes a storedby field that master's does not, so the 16-header expectation (correct where this test originated, on master) was stale once cherry-picked onto 2.43 in feat: support ENROLLMENT_OU dimension in TE queries (DHIS2-21072)  #24408.
  • This is a test-authoring bug, not a product defect — the API returns the same, correct 17-header shape for both .ou and .ENROLLMENT_OU spellings, exactly as intended.
  • No production code changes.

Discovered while investigating an apparently-unrelated CI failure on #24491 (perf: pre-filter geoFeatures org units by geometry, backport to 2.43) — that PR doesn't touch any tracked-entity analytics code and was unaffected by this. Confirmed via a trivial no-op test branch (#24505) that this failure is pre-existing on 2.43 regardless of any other PR content.

Full root-cause writeup: see the attached notes below (not yet filed as a Jira ticket).

Root cause detail

Diffing the two tests' expected row-value lists showed they were identical except the ENROLLMENT_OU variant was missing one blank "" placeholder (for the storedby column) in each of the three sample rows, and the headers/width/headerWidth assertions were set to 16 instead of 17 to match. Confirmed on master (via a locally-built image + direct API probe) that both .ou and ENROLLMENT_OU correctly return 16 headers there (master has no storedby field), so master's version of this test needs no change.

Test plan

  • Applied the same fix locally, built a 2.43 image from unmodified production code, and ran queryWithProgramAndFilterByEnrollmentOuKeyword against it with the Sierra Leone e2e dataset: Tests run: 1, Failures: 0.
  • Confirmed the corrected row-value lists are byte-for-byte identical to the passing sibling test queryWithProgramAndFilterByEnrollmentOrgUnit.

🤖 Generated with Claude Code

queryWithProgramAndFilterByEnrollmentOuKeyword asserted 16 headers/columns,
one short of the 17 its sibling queryWithProgramAndFilterByEnrollmentOrgUnit
correctly asserts for the equivalent `.ou` query. 2.43's TrackedEntityStaticField
includes a storedby field that master's does not, so the 16-header expectation
(correct on master, where this test originated) became stale once cherry-picked
onto 2.43. Verified the corrected assertions exactly match the sibling test's
row data and pass against a live server.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jason-p-pickering jason-p-pickering added the run-api-analytics-tests Enables analytics e2e tests label Jul 19, 2026
@sonarqubecloud

Copy link
Copy Markdown

@jason-p-pickering
jason-p-pickering requested review from a team and vietnguyen July 20, 2026 06:12
@jason-p-pickering
jason-p-pickering merged commit 68b2b9c into 2.43 Jul 20, 2026
25 checks passed
@jason-p-pickering
jason-p-pickering deleted the fix/te-enrollmentou-header-test-offbyone-2.43 branch July 20, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-api-analytics-tests Enables analytics e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants