Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FileMagic opened this issue Jun 27, 2024 · 0 comments
Open

Comments

@FileMagic
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant