COLLECTION_SEMANTICS_PLAN_WORKFLOW_RUNTIME_TESTS

Plan: Add workflow_runtime Test Category

Overview

Add a third test reference type to the collection semantics spec for end-to-end workflow execution tests. Currently the spec supports tool_runtime and workflow_editor; this adds workflow_runtime.

Prerequisites completed:

Design: Pydantic Model

Mirrors the existing tool_runtime pattern with a Union of two models:

WorkflowRuntimeApi

For pytest node IDs referencing procedural API tests in test_workflows.py:

class WorkflowRuntimeApi(BaseModel):
    api_test: str  # e.g., "test_workflows.py::TestWorkflowApi::test_map_over_paired"

WorkflowRuntimeFramework

For parametrized test IDs referencing YAML-based framework workflow tests:

class WorkflowRuntimeFramework(BaseModel):
    framework_test: str  # e.g., "flatten_collection_0"

Union

WorkflowRuntimeTest = Union[WorkflowRuntimeApi, WorkflowRuntimeFramework]

class ExampleTests(BaseModel):
    tool_runtime: Optional[ToolRuntimeTest] = None
    workflow_editor: Optional[str] = None
    workflow_runtime: Optional[WorkflowRuntimeTest] = None  # new

YAML Usage

- example:
    label: BASIC_MAPPING_PAIRED
    tests:
        tool_runtime:
            tool: collection_paired_test
        workflow_editor: "accepts paired data -> data connection"
        workflow_runtime:
            api_test: "test_workflows.py::TestWorkflowApi::test_map_over_paired"

Or with framework tests:

        workflow_runtime:
            framework_test: "flatten_collection_0"

Implementation Steps

Step 1: Add Pydantic models

Add WorkflowRuntimeApi, WorkflowRuntimeFramework, and WorkflowRuntimeTest union to semantics.py. Add workflow_runtime field to ExampleTests.

Note: Because ExampleTests has extra="forbid", this step MUST be completed before adding any workflow_runtime entries to the YAML — otherwise parsing will reject the unknown field.

Step 2: Add validate_workflow_runtime_refs() validator

Follow the established pattern from validate_api_test_refs(), validate_tool_refs(), and validate_workflow_editor_refs():

Step 3: Add unit tests for new validator

Follow the pattern in test_collection_semantics.py:

Step 4: Add initial workflow_runtime references to YAML

Populate workflow_runtime entries for spec examples where matching workflow tests exist.

Key test sources:

Step 5: (Optional) Render test references in generated markdown

Extend generate_docs() to emit workflow_runtime test references alongside existing test info.

Step 6: Regenerate docs

Run PYTHONPATH=lib python lib/galaxy/model/dataset_collections/types/semantics.py

Critical Files

FileRole
lib/galaxy/model/dataset_collections/types/semantics.pyAdd Pydantic models + validator
lib/galaxy/model/dataset_collections/types/collection_semantics.ymlAdd workflow_runtime references
test/unit/data/model/test_collection_semantics.pyUnit tests for new validator
lib/galaxy_test/api/test_workflows.pyProcedural API workflow tests to reference
lib/galaxy_test/workflow/test_framework_workflows.pyFramework workflow test runner
doc/source/dev/collection_semantics.mdRegenerate

Unresolved Questions

  1. Field naming: framework_test vs workflow vs yaml_test for framework workflow references?
  2. Support bare string form (workflow_runtime: "test_id") as shorthand?
  3. Scope of initial YAML additions - comprehensive survey of all matching tests, or just obvious ones?
  4. Doc rendering of test references - do this now or defer?