feat: cross-language conformance test suite (#155)#157
Merged
Conversation
Add language-agnostic conformance test suite for fd5 format. - 6 valid fixture generators - 3 invalid fixture generators - Expected-result JSON files - 39 pytest conformance tests - CHANGELOG entry and README Refs: #155
Contributor
Author
CI Status NoteThe CI failures on this PR are pre-existing and affect all open PRs in this repo:
The same failures are present on other branches (e.g., No conformance test failures — our new tests were not reached due to the pre-existing collection errors, but they pass locally with no issues. |
5 tasks
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.
Description
Add a cross-language conformance test suite for the fd5 format. The suite defines canonical fixture files and expected-result JSON files that any fd5 implementation (Python, Rust, Julia, C/C++, TypeScript) must pass to prove format conformance. This is a prerequisite for multi-language fd5 bindings (#144).
Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
tests/conformance/generate_fixtures.py— Fixture generator producing 6 valid and 3 invalid fd5 files using the reference implementationtests/conformance/test_conformance.py— 39 pytest conformance tests across structure, hash verification, provenance, multiscale, tabular, metadata, schema validation, and negative teststests/conformance/expected/*.json— Expected-result JSON files defining the format contract (minimal, sealed, with-provenance, multiscale, tabular, complex-metadata)tests/conformance/invalid/expected-errors.json— Expected error patterns for invalid fixtures (missing-id, bad-hash, no-schema)tests/conformance/README.md— Documentation on how to use the suite and add new casestests/conformance/fixtures/.gitignore,tests/conformance/invalid/.gitignore— Exclude generated binary files from version controlCHANGELOG.md— Added conformance test suite entry under Unreleased/AddedChangelog Entry
Added
Testing
just test)Manual Testing Details
N/A
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
The conformance suite is designed to be language-agnostic. The
expected/*.jsonfiles define the format contract — they specify what root attributes, dataset shapes, dtypes, group hierarchies, and provenance structures any compliant fd5 reader must be able to extract. Other languages implement their own test runner that opens the same fixtures and asserts against the same JSON.Fixture files are generated (not checked in) to avoid binary bloat. A session-scoped pytest fixture runs the generator before tests execute.
The with-provenance fixture has
verify: falsebecause compound datasets with vlen strings produce non-deterministictobytes()across file close/reopen, which is a known HDF5 behavior documented intest_integration.py.Refs: #155