feat: add golden conformance test suite for format conversion and mappings#88
feat: add golden conformance test suite for format conversion and mappings#88
Conversation
…pings Adds 14 golden-file tests that detect output drift across parsers, serializers, and the mapping evaluator: - 7 format conversion tests (JSON/CSV/YAML cross-product) - 4 mapping tests (rename, select, filter, complex pipeline) - 3 round-trip consistency tests (JSON↔YAML, JSON↔CSV, YAML↔CSV) Golden files can be updated with: UPDATE_GOLDEN=1 cargo test --test golden_conformance Fixes #82
|
CI triage: Linux/macOS are green, but both Windows jobs fail in with broad golden mismatches (11 tests).\n\nLikely cause: line-ending normalization ( vs ) in golden fixture comparisons rather than logic regressions, since round-trip tests still pass and failures are across many text outputs at once.\n\nSuggested fix:\n1) Normalize before compare in test helper (e.g. )\n2) Or enforce LF for golden fixtures via :\n - \n3) Keep output normalization deterministic (trim trailing whitespace/newlines consistently).\n\nIf you want, I can open a follow-up PR/commit with normalization in the test harness. |
|
Correction (formatting): Windows failures in PR #88 are likely line-ending normalization issues in golden-file comparisons (CRLF vs LF), not core logic regressions, since Linux/macOS are green and round-trip tests pass. Suggested fix: normalize line endings in test compare helper (replace CRLF with LF before assert), and optionally enforce LF in tests/golden via .gitattributes. I can help with a follow-up patch if needed. |
Summary
Adds a golden-file conformance test suite to detect output drift across morph's parsers, serializers, and mapping evaluator.
Tests added (14 total)
Format conversion (7 tests):
Mapping operations (4 tests):
rename— field renamingselect— field selectionwhere— row filteringRound-trip consistency (3 tests):
Structure
Updating golden files
After an intentional output change:
UPDATE_GOLDEN=1 cargo test --test golden_conformanceFixes #82