Skip to content

With Items Causing Workflow Tests to Fail When Items are an Empty List #268

Open
@FileMagic

Description

@FileMagic

Let's say that you have a workflow:

example_workflow.yaml

version: 1.0
tasks:
  start:
    action: core.noop
    next:
      - when: <% succeeded() %>
        do:
          - with_items_task_example
  with_items_task_example: # This shouldn't run
  action: core.echo
  with:
    items: <% [] %>
  input:
    message: <% item() %>

You can try to write the following workflow test:
workflow_test.yaml

---
  workflow: "example_workflow.yaml"
  expected_routes: [[]]
  inputs: {}

  expected_task_sequence:
    - start
    - with_items_task_example

  mock_action_executions: []

  expected_workflow_status: succeeded

If we were to test this using the orquesta test, this would fail due to the items from the with items call within the with_items_task_example task. The error would be - ERROR - list assignment index out of range.

I am guessing that orquesta when running the test doesn't properly handle the list. Where as if you were to run this in st2 it would run without a hitch.

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