Skip to content

Fix 22 failing tests: Compression platform guards, FHIR XML round-trip, ObjectPool regression#72

Merged
SureshKViswanathan merged 3 commits intomainfrom
copilot/work-on-next-task-95554e62-06e8-4601-8826-4c969e6d1d91
Feb 19, 2026
Merged

Fix 22 failing tests: Compression platform guards, FHIR XML round-trip, ObjectPool regression#72
SureshKViswanathan merged 3 commits intomainfrom
copilot/work-on-next-task-95554e62-06e8-4601-8826-4c969e6d1d91

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 18, 2026

Description

Resolve all 22 remaining test failures: 17 CompressionTests (platform), 4 FHIRXMLSerialization (broken round-trip), 1 ObjectPool regression (incorrect test math). Test suite now at 3073 passing, 0 failures.

Related Issues

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance improvement
  • Documentation update
  • Code refactoring
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Security fix

Changes Made

CompressionTests — 17 failures → 17 skips

  • Added requireCompression() helper using #if !canImport(Compression) + XCTSkip. Apple's Compression framework doesn't exist on Linux; tests now skip cleanly instead of throwing unexpected errors.

FHIRXMLSerialization — 4 failures → 0

  • XML encoder: primitive arrays (given: ["Alice"]) were silently dropped. Fixed buildElement to recurse on non-dict array items.
  • XML decoder: added convertToFHIRJSON() post-processing in FHIRXMLParser:
    • Unwraps root element name → resourceType
    • Flattens {"value": "x"}"x" for FHIR primitive types
    • Filters xmlns attributes
    • FHIR-aware array field mapping (fhirArrayFields) to correctly wrap single-element arrays
  • Test XML: added required messageID/timestamp fields to manually-crafted XML in testResourceContainerXMLDecoding

ObjectPool regression — 1 failure → 0

  • Original test: preallocate(20) then acquire(100) sequentially = 20/100 = 20% reuse, but asserted >30%. Mathematically impossible.
  • Fix: two-cycle acquire-release pattern. First cycle populates pool, second cycle demonstrates reuse → 70%.

milestone.md — Updated test stats and fix details.

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • Performance tests added/updated
  • Code coverage ≥ 90%

Manual Testing

swift test  # 3073 passed, 17 skipped (compression/Linux), 0 failures
swift test --filter CompressionTests        # 8 passed, 17 skipped
swift test --filter FHIRXMLSerializationTests  # 13 passed
swift test --filter testObjectPoolRegressionBaseline  # 70% reuse, passed

Documentation

  • API documentation added/updated (DocC comments)
  • README.md updated (if applicable)
  • Examples updated (if applicable)
  • CHANGELOG.md updated under "Unreleased" section
  • Migration guide updated (if breaking change)

Standards Compliance

  • HL7 v2.x (version: _____)
  • HL7 v3.x / CDA
  • FHIR (version: R4) — XML serialization round-trip now works correctly

Checklist

  • My code follows the project's style guidelines (CODING_STANDARDS.md)
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have checked my code for security vulnerabilities
  • I have removed all PHI/sensitive data from tests and examples

Performance Impact

  • Throughput: no change
  • Latency: no change
  • Memory usage: no change

Breaking Changes

None.

Screenshots (if applicable)

N/A

Additional Notes

The fhirArrayFields mapping in FHIRXMLParser covers Patient, Observation, Practitioner, MedicationRequest, Bundle, Encounter, and common complex types. New resource types will need entries added if they use single-element arrays in XML round-trips.


For Reviewers:

  • Code quality and style
  • Test coverage adequate
  • Documentation complete
  • No security concerns
  • Performance acceptable
  • Standards compliance verified

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 18, 2026 14:46
…L round-trip, ObjectPool regression

Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Co-authored-by: SureshKViswanathan <257696045+SureshKViswanathan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update code for upcoming task Fix 22 failing tests: Compression platform guards, FHIR XML round-trip, ObjectPool regression Feb 18, 2026
@SureshKViswanathan SureshKViswanathan marked this pull request as ready for review February 19, 2026 05:58
@SureshKViswanathan SureshKViswanathan merged commit 98ef983 into main Feb 19, 2026
8 checks passed
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