cwl-to-test-data
Resolve the CWL workflow’s own declared test cases into Galaxy test-data-refs. The CWL summary carries the source’s test cases (tests[]) — each a job_path (a CWL job file naming the test inputs) plus expected_outputs. Read the declared inputs and map them onto the Galaxy workflow’s inputs, emitting one ref per input, ready for implement-galaxy-workflow-test to stage.
This Mold is the source-specific first leg of the harness’s test-data-resolution branch. It resolves what the CWL source itself declares; any input it cannot resolve from a declared test case stays a reported gap and the harness falls through to find-test-data (search), then to user-supplied. Deciding to fall through is a harness concern, not this Mold’s — its job is an honest map of the source’s own test cases.
Sequence
- Enumerate Galaxy inputs and their required shape. From the interface brief, list each workflow input: label, Galaxy collection shape (File / list / paired / list:paired / record), and datatype. This is the target shape every ref must satisfy.
- Read the declared test cases. From the summary’s
tests[], read each case’s job_path inputs — File/Directory objects with their location/path, secondaryFiles, arrays, and inline literals — plus expected_outputs. Prefer the case whose inputs best cover the workflow’s inputs.
- Map each declared input onto a Galaxy input. Match by id and shape onto the interface’s input labels. A CWL File array maps to a Galaxy list; a File carrying
secondaryFiles may map to a record or composite datatype — record element identifiers and any prep needed to reach the Galaxy collection shape (galaxy-workflow-testability-design).
- Emit refs. Write one
test-data-refs.json entry per resolved input: prefer a remote location URL when the job references one (remote-URL-first, iwc-test-data-conventions); fall back to the in-tree path plus provenance only when no URL is published. Carry datatype, collection element identifiers, and any subset/split prep. Each entry maps to an addressable workflow input label. Shape each entry per test-data-refs with resolved_by: cwl-to-test-data, and validate the file with foundry validate-test-data-refs before returning.
- Report genuine gaps. An input with no declared test-case input of the right shape stays
resolved: false with a reason and storage: unresolved — this is what the harness hands to find-test-data. Do not search public sources here; searching is find-test-data’s job, not this Mold’s.
No fabrication
Never invent a URL, accession, or path, and never emit a placeholder for an input you could not resolve from a declared test case. A declared input with no published URL is recorded by its in-tree path plus provenance, not papered over with a guessed URL. Every emitted ref points at data the source actually declares; everything else is an honest gap for the next leg of the branch.