Agent Skill · cast nextflow-to-test-data
Resolve a Nextflow pipeline's own declared test fixtures into Galaxy workflow test-data refs.
← All cast skills · Source mold →
Install with Claude Code
/plugin marketplace add galaxyproject/foundry
/plugin install foundry-skills@galaxy-workflow-foundry
Then invoke as:
/foundry-skills:nextflow-to-test-data
Install with Codex
codex plugin marketplace add galaxyproject/foundry
codex plugin add foundry-skills@galaxy-workflow-foundry
Then select with /skills or invoke explicitly as:
$nextflow-to-test-data
Skill Bundle
/ packaged cast
- attached files
- 5
- upfront
- 1
- on demand
- 4
- cast rev
- n/a
- validated
- 0
Produces: 1 artifact.
Consumes: 2 artifacts.
Artifact Contract
/ skill handoff Produces
test-data-refs
Test data resolved from the pipeline's declared fixtures, expressed as URLs/paths plus expected shapes for downstream test authoring. Shared id with [[find-test-data]] — the branch's search fallback fills only the inputs this Mold leaves unresolved.
jsontest-data-refs.json
Raw artifact contract
{
"id": "test-data-refs",
"kind": "json",
"default_filename": "test-data-refs.json",
"description": "Test data resolved from the pipeline's declared fixtures, expressed as URLs/paths plus expected shapes for downstream test authoring. Shared id with [[find-test-data]] — the branch's search fallback fills only the inputs this Mold leaves unresolved."
}
Consumes
summary-nextflow
Structured Nextflow summary from [[summarize-nextflow]]; carries the selected profile's `test_fixtures` and the full `nf_tests[]` enumeration — each declared input a role plus url/path, sha1, and filetype.
Raw artifact contract
{
"id": "summary-nextflow",
"description": "Structured Nextflow summary from [[summarize-nextflow]]; carries the selected profile's `test_fixtures` and the full `nf_tests[]` enumeration — each declared input a role plus url/path, sha1, and filetype.",
"inherited_schema": "[[summary-nextflow]]",
"producers": [
"summarize-nextflow"
]
}
nextflow-galaxy-interface
Galaxy interface brief from [[nextflow-summary-to-galaxy-interface]] pinning the workflow input labels, collection shapes, and datatypes each resolved fixture must map onto.
Raw artifact contract
{
"id": "nextflow-galaxy-interface",
"description": "Galaxy interface brief from [[nextflow-summary-to-galaxy-interface]] pinning the workflow input labels, collection shapes, and datatypes each resolved fixture must map onto.",
"producers": [
"nextflow-summary-to-galaxy-interface"
]
}
Attached Files
/ runtime references Load upfront
schema
summary-nextflow
packaged Input contract: read the selected profile's `test_fixtures.inputs[]` and the `nf_tests[]` enumeration — role, url/path, sha1, filetype — as the declared source of test data.
upfront runtime verbatim corpus-observed deterministic 58.7 KB
- bundle
references/schemas/summary-nextflow.schema.json - source
package://@galaxy-foundry/summarize-nextflow#summaryNextflowSchema
Preview json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://galaxyproject.org/foundry/schemas/summary-nextflow.schema.json",
"$comment": "Canonical source: packages/summarize-nextflow/src/schema/summary-nextflow.schema.json in galaxyproject/foundry. Mold frontmatter cites this schema via [[summary-nextflow]] wiki-links; the cast pipeline imports the `summaryNextflowSchema` runtime export and serializes it into cast bundles.",
"title": "Nextflow Pipeline Summary",
"description": "Structured per-source summary emitted by the summarize-nextflow Mold.\n\nPer-source schema by design — paper, Nextflow, and CWL each have their own summary shape; downstream Molds (data flow, templates, tool wrappers) consume any source's summary and handle the polymorphism.\n\nField names mirror gxy-sketches' SketchSource / ToolSpec / TestDataRef / ExpectedOutputRef where parity exists; see content/research/gxy-sketches-alignment.md.",
"$ref": "#/$defs/Summary",
"$defs": {
"Summary": {
"title": "Summary",
"description": "Top-level shape. Every Nextflow summary is exactly this object.",
"type": "object",
"additionalProperties": false,
"required": [
"source",
"params",
"sample_sheets",
"profiles",
"tools",
"processes",
"subworkflows",
"workflow",
"reference_assets",
"reference_rebuilds",
"test_fixtures",
"nf_tests"
],
"properties": {
"source": {
"$ref": "#/$defs/SourceRecord"
},
"params": {
"type": "array",
"items": {
"$ref": "#/$defs/Param"
}
},
"sample_sheets": {
"type": "array",
"items": {
"$ref": "#/$defs/SampleSheet"
},
"description": "Structured sample-sheet inputs. Each entry binds one `params[]` parameter to a row schema (column names, types, path-vs-meta classification, required flags, enums, patterns). Promoted from prose inside `params[].description` so downstream target translations (Galaxy `sample_sheet*` collections, CWL records-of-arrays) can choose collection variants without re-parsing the source pipeline. Empty array when no sample-sheet idiom is detected. Discovery sources: nf-schema `schema:` references, `samplesheetToList()` calls, and `splitCsv(header: true
...
Load on demand
Interpret nf-test profiles and fixture conventions before mapping declared fixtures onto Galaxy inputs.
Trigger: When reading `test_fixtures` / `nf_tests` to decide which profile's fixtures best cover the workflow inputs.
on-demand runtime verbatim hypothesis deterministic 5.1 KB
- bundle
references/notes/component-nextflow-testing.md - source
content/research/component-nextflow-testing.md
Preview md
---
type: research
subtype: component
tags:
- research/component
- source/nextflow
component: "Nextflow Testing and Test Fixtures"
status: draft
created: 2026-05-01
revised: 2026-05-05
revision: 2
ai_generated: true
summary: "nf-test patterns mapped to Galaxy planemo asserts and CWL test equivalents — backs nextflow-test-to-target-tests Mold and summarize-nextflow §7."
companions:
- "component-nextflow-testing.yml"
sources:
- "https://www.nf-test.com/"
- "https://www.nf-test.com/docs/assertions/"
- "https://www.nf-test.com/docs/assertions/snapshots/"
- "https://www.nf-test.com/docs/configuration/"
- "https://nf-co.re/docs/contributing/nf-test/assertions"
- "https://nf-co.re/docs/developing/testing/overview"
- "https://github.com/nf-core/test-datasets"
- "https://www.nextflow.io/docs/latest/config.html#config-profiles"
- "https://nf-co.re/docs/contributing/pipelines#test-data"
related_molds:
- "[[summarize-nextflow]]"
- "[[nextflow-test-to-target-tests]]"
- "[[implement-galaxy-workflow-test]]"
related_notes:
- "[[planemo-asserts-idioms]]"
- "[[tests-format]]"
- "[[iwc-test-data-conventions]]"
- "[[component-nf-core-tools]]"
---
# Nextflow Testing and Test Fixtures
Operational grounding for two Molds:
- [[summarize-nextflow]] §7 — extract `nf_tests[]` and `test_fixtures` from a real nf-core or DSL2 pipeline.
- [[nextflow-test-to-target-tests]] — translate nf-test fixtures + assertions into Galaxy / CWL equivalents.
The summarize side is mostly *enumeration*: walk `tests/*.nf.test`, extract structured fields per the Mold §7 spec. The translation side is *mapping*: each nf-test assertion pattern has a (sometimes lossy) Galaxy or CWL equivalent.
Companion structured form: `component-nextflow-testing.yml`. Per-pattern entries with `n
...
Interpret nf-test profiles and fixture conventions before mapping declared fixtures onto Galaxy inputs.
Trigger: When reading `test_fixtures` / `nf_tests` to decide which profile's fixtures best cover the workflow inputs.
on-demand runtime verbatim hypothesis deterministic 11.6 KB
- bundle
references/notes/component-nextflow-testing.yml - source
content/research/component-nextflow-testing.yml
Preview yml
# nf-test patterns → Galaxy / CWL test equivalents.
# Companion to component-nextflow-testing.md.
#
# Rows ordered by frequency in real nf-core pipelines (snapshot block first).
mappings:
# ---- Snapshot block (nf-core canonical idiom) ----
- id: snapshot.match
nf_test_pattern: "assert snapshot(...).match()"
description: "Top-level snapshot assertion comparing serialized form of N captured values to a stored .nf.test.snap file."
galaxy_equivalent: "Per-output assertion block in <workflow>-tests.yml; no single-line analog. Decompose into per-capture assertions (rows below)."
cwl_equivalent: "cwltest expected_outputs entries per output; no single-line analog. Decompose."
target_link: "[[tests-format]]"
notes: "The whole-snapshot idiom is lossy on translation; explode into N per-capture assertions and accept the surface-area increase."
- id: snapshot.succeeded_task_count
nf_test_pattern: "workflow.trace.succeeded().size()"
description: "Count of successfully completed tasks. nf-core canonical first capture; brittle across pipeline versions but stable per release."
galaxy_equivalent: "Implicit in workflow execution success. Galaxy workflow tests pass iff the workflow completes; per-step success surfaces via has_text on log outputs."
cwl_equivalent: "Implicit in cwltest's `should_succeed` / `should_fail` boolean. No per-task count."
target_link: "[[planemo-asserts-idioms]] §1 (Plain text reports / logs)"
notes: "Drop on translation; targets verify success implicitly."
- id: snapshot.versions_yml
nf_test_pattern: "ch_versions or path('versions.yml')"
description: "The `versions` topic channel collected per process and dumped to versions.yml at workflow end. nf-core canonical second capture."
galaxy_equiv
...
Map each declared fixture to an addressable Galaxy input label and the collection shape it must populate.
Trigger: When mapping a declared fixture (often a samplesheet-driven input) onto a Galaxy input's collection shape.
on-demand runtime verbatim corpus-observed deterministic 11.4 KB
- bundle
references/notes/galaxy-workflow-testability-design.md - source
content/research/galaxy-workflow-testability-design.md
Preview md
---
type: research
subtype: component
tags:
- research/component
- target/galaxy
status: draft
created: 2026-05-03
revised: 2026-05-06
revision: 2
ai_generated: true
related_notes:
- "[[iwc-workflow-testability-survey]]"
- "[[iwc-test-data-conventions]]"
- "[[planemo-asserts-idioms]]"
- "[[iwc-shortcuts-anti-patterns]]"
- "[[planemo-workflow-test-architecture]]"
- "[[implement-galaxy-workflow-test]]"
- "[[gxformat2-schema]]"
- "[[gxformat2-workflow-inputs]]"
- "[[galaxy-datatypes-conf]]"
summary: "Design guidance for Galaxy workflow inputs, outputs, and checkpoints that make IWC-style workflow tests possible."
---
# Galaxy workflow testability design
Use this note when authoring or translating a Galaxy workflow **before** the `-tests.yml` file exists. It covers workflow structure choices that make later IWC-style tests meaningful: labels, promoted checkpoints, collection identifiers, and fixture-compatible inputs.
This is not a `content/patterns/` page. It is cross-cutting design guidance for Molds that need testable Galaxy workflows. Assertion syntax lives in [[planemo-asserts-idioms]]. Test YAML fixture shapes live in [[iwc-test-data-conventions]]. Accepted shortcut vs smell calls live in [[iwc-shortcuts-anti-patterns]]. Corpus evidence trail lives in [[iwc-workflow-testability-survey]].
## 1. Treat labels as API
Workflow input and output labels are not cosmetic. Planemo and IWC tests address workflow inputs and outputs by label, and the survey found exact label matches for every asserted output across 114 matched workflow/test pairs. A generated workflow should therefore pick stable, descriptive labels before test authoring starts.
Rules:
- Label every output that may need a test assertion.
- Treat input/output renames as breaking changes
...
Express each ref remote-URL-first with SHA-1 integrity and per-input collection layout when recording resolved fixtures.
Trigger: When writing each `test-data-refs` entry.
on-demand runtime verbatim corpus-observed deterministic 21.1 KB
- bundle
references/notes/iwc-test-data-conventions.md - source
content/research/iwc-test-data-conventions.md
Preview md
---
type: research
subtype: component
tags:
- research/component
- target/galaxy
status: draft
created: 2026-04-30
revised: 2026-05-03
revision: 3
ai_generated: true
related_notes:
- "[[galaxy-workflow-testability-design]]"
- "[[iwc-shortcuts-anti-patterns]]"
- "[[planemo-asserts-idioms]]"
- "[[implement-galaxy-workflow-test]]"
- "[[tests-format]]"
- "[[iwc-tabular-operations-survey]]"
summary: "How IWC workflows organize and reference test data — Zenodo-first, SHA-1 integrity, collection shapes, CVMFS gotchas."
---
# IWC test data conventions
Reference for an agent implementing or editing a `<workflow>-tests.yml` in IWC style. All evidence cited from `/Users/jxc755/projects/repositories/workflow-fixtures/iwc-src/workflows/` (raw IWC clone) and `workflows/README.md`. Authoritative spec: [planemo.readthedocs.io/en/latest/test_format.html](https://planemo.readthedocs.io/en/latest/test_format.html). The companion analysis at `/Users/jxc755/projects/repositories/galaxy-brain/vault/projects/workflow_state/skills/COMPONENT_GALAXY_WORKFLOW_TESTING.md` is the synthesized source for several normative claims here.
This note owns **test YAML fixture shapes**. For workflow-structure choices that make those fixtures possible before the test file exists, use [[galaxy-workflow-testability-design]].
## 1. Where does test data live? Remote vs in-repo
Two storage patterns. They mix freely inside one job.
**Remote `location:` (default for any non-trivial input).** Strongly preferred for anything bigger than a toy fixture. Order of preference, observed in the corpus:
- **Zenodo** — overwhelming default, persistent DOI-backed URL.
- `read-preprocessing/short-read-qc-trimming/short-read-quality-control-and-trimming-tests.yml:13,17` — `https://zenodo.org/records/11484
...
SKILL.md
# nextflow-to-test-data
Follow the procedure below and use the artifact/reference sections as the runtime contract.
## When To Use
- Resolve a Nextflow pipeline's own declared test fixtures into Galaxy workflow test-data refs.
## Inputs
- Read artifact `summary-nextflow`. Schema: summary-nextflow. Produced by `summarize-nextflow`. Structured Nextflow summary from summarize-nextflow; carries the selected profile's `test_fixtures` and the full `nf_tests[]` enumeration — each declared input a role plus url/path, sha1, and filetype.
- Read artifact `nextflow-galaxy-interface`. Produced by `nextflow-summary-to-galaxy-interface`. Galaxy interface brief from nextflow-summary-to-galaxy-interface pinning the workflow input labels, collection shapes, and datatypes each resolved fixture must map onto.
## Outputs
- Write artifact `test-data-refs` as `test-data-refs.json`. Format: `json`. Test data resolved from the pipeline's declared fixtures, expressed as URLs/paths plus expected shapes for downstream test authoring. Shared id with find-test-data — the branch's search fallback fills only the inputs this Mold leaves unresolved.
## Required Tools
- None declared. Procedure should not assume external CLIs are present.
## Load Upfront
- `references/schemas/summary-nextflow.schema.json`: Schema file copied verbatim into the bundle. Input contract: read the selected profile's `test_fixtures.inputs[]` and the `nf_tests[]` enumeration — role, url/path, sha1, filetype — as the declared source of test data.
## Load On Demand
- `references/notes/component-nextflow-testing.md`: Research note copied verbatim into the bundle. Interpret nf-test profiles and fixture conventions before mapping declared fixtures onto Galaxy inputs. Use when: reading `test_fixtures` / `nf_tests` to decide which profile's fixtures best cover the workflow inputs.
- `references/notes/component-nextflow-testing.yml`: Companion file copied verbatim into the bundle. Sibling of `references/notes/component-nextflow-testing.md`; read it where that note directs.
- `references/notes/galaxy-workflow-testability-design.md`: Research note copied verbatim into the bundle. Map each declared fixture to an addressable Galaxy input label and the collection shape it must populate. Use when: mapping a declared fixture (often a samplesheet-driven input) onto a Galaxy input's collection shape.
- `references/notes/iwc-test-data-conventions.md`: Research note copied verbatim into the bundle. Express each ref remote-URL-first with SHA-1 integrity and per-input collection layout when recording resolved fixtures. Use when: writing each `test-data-refs` entry.
## Validation
- None declared.
## Procedure
Resolve the Nextflow pipeline's own declared test fixtures into Galaxy `test-data-refs`. The Nextflow summary already carries the `test`-profile fixtures (`test_fixtures`) and the full nf-test enumeration (`nf_tests[]`) — each declared input a `role` plus a `url`/`path`, `sha1`, and `filetype`. Map those onto the Galaxy workflow's inputs and emit one ref per input, ready for implement-galaxy-workflow-test to stage.
This skill is the source-specific first leg of the harness's `test-data-resolution` branch. It resolves what the pipeline itself declares; any input it cannot resolve from a declared fixture 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 skill's — its job is an honest map of the pipeline's own fixtures.
### Sequence
1. **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.
2. **Read the declared fixtures.** From the summary's `test_fixtures.inputs[]` (selected profile) and `nf_tests[]` (other profiles), collect each declared input: `role`, `url`/`path`, `sha1`, `filetype`, and description. Prefer the profile whose fixtures best cover the workflow's inputs.
3. **Map each declared fixture onto a Galaxy input.** Match by role and shape onto the interface's input labels. A samplesheet-driven Nextflow input often expands into a Galaxy collection — record the element identifiers and any split/concatenation prep needed to reach the Galaxy collection shape (galaxy-workflow-testability-design).
4. **Emit refs.** Write one `test-data-refs.json` entry per resolved input: prefer the declared remote `url` + `sha1` (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.
5. **Report genuine gaps.** An input with no declared fixture of the right shape stays `resolved: false` with a reason — 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 skill'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 fixture. A declared fixture 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 pipeline actually declares; everything else is an honest gap for the next leg of the branch.
## Runtime Notes
- Do not read Foundry source files at runtime; use only files packaged in this skill bundle and user-supplied artifacts.
- Preserve declared artifact filenames unless the user or harness supplies explicit paths.
- Carry unresolved assumptions into the output artifact instead of silently inventing missing source evidence.