framework workflow tests: add inline user-defined tool case

Adds inline_user_defined_tool.gxwf.yml plus matching .gxwf-tests.yml to
lib/galaxy_test/workflow/. Workflow embeds the cat_user_defined UDT body
(matches test/functional/tools/cat_user_defined.yml) under a format2
run: block. Test job pipes inline content through the UDT and asserts
the output text.

Exercises end-to-end:
- gxformat2 _expand_format2 GalaxyUserToolStub pass-through (PR #218);
  without the fix _expand_format2 strips the stub to run=None and
  workflow import fails or silently drops the step
- Workflow import with embedded tool_representation
- On-import DynamicTool registration from the inline body
- YAML tool runtime execution in a container

The framework runner globs *.gxwf.yml and discovers the new pair via
pytest_generate_tests. Confirmed local: pytest collects
test_workflow[inline_user_defined_tool_0]; ensure_format2 +
ensure_native both preserve the GalaxyUserTool body; gxwf validate /
lint report the step as OK with only generic creator/license warnings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
John Chilton
2026-05-23 07:51:24 -04:00
co-authored by Claude Opus 4.7
parent 3c1a7eda52
commit 7096e0e89e
2 changed files with 46 additions and 0 deletions
@@ -0,0 +1,12 @@
- doc: |
INLINE_UDT_BASIC: Cat through a single inline user-defined tool step.
Input file content round-trips to the workflow output unchanged.
job:
input1:
class: File
contents: "hello inline udt\n"
outputs:
wf_output:
asserts:
- that: has_text
text: "hello inline udt"
@@ -0,0 +1,34 @@
class: GalaxyWorkflow
doc: |
Workflow with one inline user-defined tool (UDT) step. Exercises the
end-to-end path through Galaxy: format2 normalization (including
_expand_format2 pass-through for GalaxyUserToolStub, gxformat2 PR #218),
workflow import with tool_representation, on-import DynamicTool
registration, and execution via the YAML tool runtime.
inputs:
input1:
type: data
outputs:
wf_output:
outputSource: udt_cat/output1
steps:
udt_cat:
run:
class: GalaxyUserTool
id: cat_user_defined
version: "0.1"
name: cat_user_defined
description: concatenates a file
container: busybox
shell_command: cat '$(inputs.input1.path)' > output.txt
inputs:
- name: input1
type: data
format: txt
outputs:
- name: output1
type: data
format: txt
from_work_dir: output.txt
in:
input1: input1