Skip to content

feat: cross-language conformance test suite (#155)#157

Merged
gerchowl merged 1 commit intodevfrom
feature/155-cross-language-conformance-tests
Feb 28, 2026
Merged

feat: cross-language conformance test suite (#155)#157
gerchowl merged 1 commit intodevfrom
feature/155-cross-language-conformance-tests

Conversation

@gerchowl
Copy link
Copy Markdown
Contributor

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 feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • tests/conformance/generate_fixtures.py — Fixture generator producing 6 valid and 3 invalid fd5 files using the reference implementation
  • tests/conformance/test_conformance.py — 39 pytest conformance tests across structure, hash verification, provenance, multiscale, tabular, metadata, schema validation, and negative tests
  • tests/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 cases
  • tests/conformance/fixtures/.gitignore, tests/conformance/invalid/.gitignore — Exclude generated binary files from version control
  • CHANGELOG.md — Added conformance test suite entry under Unreleased/Added

Changelog Entry

Added

  • Cross-language conformance test suite (#155)
    • 6 canonical fixture generators: minimal, sealed, with-provenance, multiscale, tabular, complex-metadata
    • 3 invalid fixture generators: missing-id, bad-hash, no-schema
    • Expected-result JSON files defining the format contract for any language binding
    • 39 pytest conformance tests covering structure, hash verification, provenance, multiscale, tabular, metadata, schema validation, and negative tests
    • README documenting how to use the suite and add new cases

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

N/A

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • 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

Additional Notes

The conformance suite is designed to be language-agnostic. The expected/*.json files 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: false because compound datasets with vlen strings produce non-deterministic tobytes() across file close/reopen, which is a known HDF5 behavior documented in test_integration.py.

Refs: #155

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
@gerchowl gerchowl self-assigned this Feb 26, 2026
@gerchowl
Copy link
Copy Markdown
Contributor Author

CI Status Note

The CI failures on this PR are pre-existing and affect all open PRs in this repo:

  • Lint: uv.lock drift — the lockfile on dev doesn't include optional deps (pydicom, nibabel, pyarrow) that were recently added to pyproject.toml. This causes pre-commit's lockfile check to fail.
  • Tests: ModuleNotFoundError for pydicom, nibabel, pyarrow — the CI workflow doesn't install optional dependency groups, so test_ingest_dicom.py, test_ingest_nifti.py, and test_ingest_parquet.py fail at collection.

The same failures are present on other branches (e.g., feature/149-preflight-feedback run #22422258963).

No conformance test failures — our new tests were not reached due to the pre-existing collection errors, but they pass locally with no issues.

@gerchowl gerchowl merged commit 636210c into dev Feb 28, 2026
3 of 7 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.

1 participant