Skip to content

Faithful BIDS-inheritance staging test via a splice-point pre-hook #384

Description

@asmacdo

Depends on: #381 (splice-point hooks) landing first.

Problem

The BIDS-inheritance grab added to participant_job.sh.jinja2 (the fixup on #376) is partially covered today:

  • Render/structure unit tests — assert the generated script text is correct (root tier resolved for every job, subject tier only for session jobs, zipped inputs skipped, common_paths threaded). These do not exercise the runtime resolve_tier (git ls-tree) logic.
  • A one-off manual assertion — a temporary block in the job template that prints the staged tiers and asserts dataset_description.json, run once to confirm staging (validated via the e2e walkthrough, then reverted — too BIDS-specific to bake into every production job).
  • The fixup removed explicit dataset_description.json from common_paths (it now defaults to []), so the e2e walkthrough fails if the grab doesn't stage it — an implicit but real regression guard.

Proposal

Once the splice-point hooks (#381) merge, we can do better. By using a pre-app hook we can add arbitrary assertions that run inside the job, i.e. this or that file is present and not a broken symlink. The hook can exit 0, bypassing the container run altogether. I suspect this could be a strong test pattern that could eventually speed up / strengthen existing tests (not in scope here though).

Assertions to make (session-level run, on a fixture or a small real dataset):

  • Positive: dataset_description.json and the root-tier inherited sidecars (e.g. T1w.json, a task-*_bold.json, participants.tsv) are present in the per-job working tree.
  • Positive (session): the subject-tier files (e.g. sub-XX/sub-XX_sessions.tsv) are present for a sub-XX/ses-YY job.
  • Negative: another subject's directory (sub-other/) is absent; for a session job, the subject's other sessions (sub-XX/ses-other/) are absent — proving the non-recursive root anchoring + sparse-checkout restriction.

Notes

  • The render/structure unit tests and the config-default test stay as the fast first line; this hook test is the integration layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions