Skip to content

unit test suite and CI#66

Merged
vtorlima merged 16 commits into
OSIPI:mainfrom
vtorlima:main
Jul 15, 2026
Merged

unit test suite and CI#66
vtorlima merged 16 commits into
OSIPI:mainfrom
vtorlima:main

Conversation

@vtorlima

@vtorlima vtorlima commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Summary
Adds the first CI pipeline, a comprehensive unit test suite, and an example-based integration test runner to the pyaslreport package. Before this, the package had no CI and only a single pre-existing test file covering get_bids_metadata orchestration. Without automated coverage, regressions in validation, parameter extraction, or report generation could go undetected.
What's included
Unit tests covering the internal processing logic:

Field renaming and unit conversion
All six validator classes (Number, String, Boolean, NumberArray, NumberOrNumberArray, Consistency) at their schema-configured boundaries, plus a schema-loading smoke test
M0 contradiction paths, TSV validation, and background-suppression warning branches
File grouping for both BIDS (exact-suffix) and DICOM (substring) modes, including TSV header enforcement

Integration tests covering the tool end-to-end:

An example-based runner: each example is a folder of real BIDS inputs plus a saved expected_output.json. Examples are discovered automatically, so contributors add test cases by dropping in a folder and running one command, no code changes required
Discovery is recursive and subject-agnostic (anchors on perf/ and BIDS filename suffixes), supporting multiple subjects, sessions, and runs in a single example
Golden/characterization comparison of the full 21-key output, including generated report text. pytest -m integration --update-expected regenerates the saved outputs when a behavior change is intended
M0/TSV pairing follows the agreed rules (1:1 by prefix; reuse the shared M0 when there are more ASLs; use the latest M0 when there are more M0s), with a PairingFallbackWarning surfaced whenever a fallback is applied
Harness self-tests that verify discovery, file ordering, pairing, and the golden update cycle, so the machinery is validated on every push even before example data is committed

CI via GitHub Actions:

Runs the unit suite on Python 3.11 and 3.12
Runs the integration suite in a separate job (-m integration), partitioning the suite with the unit job
Black and isort formatting gates (pinned in the test extra)

@jan-petr
jan-petr self-requested a review July 15, 2026 15:01

@jan-petr jan-petr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@vtorlima
vtorlima merged commit f441d73 into OSIPI:main Jul 15, 2026
4 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