specification icon indicating copy to clipboard operation
specification copied to clipboard

CTK data-flow.feature test has a bug?

Open ksanderer opened this issue 6 months ago • 5 comments

The test expects the endpoint to be resolved into https://petstore.swagger.io/v2/pet/1

https://github.com/serverlessworkflow/specification/blob/c46f1ccc172dfea27ec5fbfad4ef9e6c9fb8dd27/ctk/features/data-flow.feature#L78

  # Tests using non-object output
  Scenario: Use Non-object Output
    Given a workflow with definition:
    """yaml
    document:
      dsl: '1.0.0'
      namespace: default
      name: non-object-output
      version: '1.0.0'
    do:
      - getPetById1:
          call: http
          with:
            method: get
            endpoint:
              uri: https://petstore.swagger.io/v2/pet/{petId} #simple interpolation, only possible with top level variables
          output:
            as: .id
      - getPetById2:
          call: http
          with:
            method: get
            endpoint:
              uri: https://petstore.swagger.io/v2/pet/2
          output:
            as: '{ ids: [ $input, .id ] }'
    """
    When the workflow is executed
    Then the workflow should complete with output:
    """yaml
    ids: [ 1, 2 ]
    """

But there is no input to resolve petId into 1 for the test to succeed?

Is it a bug, or am I missing something?

This happened:

The tests fail since there is no way to resolve https://petstore.swagger.io/v2/pet/{petId} into https://petstore.swagger.io/v2/pet/1

I expected this:

Either the test fails, or the test input needs to be added.

Area(s)

CTK

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.name: Bug Report 🐞

ksanderer avatar Jun 18 '25 15:06 ksanderer

@ksanderer Good catch. It's missing a "Given input" clause, as that's where the petId was expected to be defined when the test was authored.

cdavernas avatar Jun 18 '25 16:06 cdavernas

@ksanderer mind sending a PR to fix it?

ricardozanini avatar Jun 19 '25 13:06 ricardozanini

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 05 '25 00:08 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Sep 20 '25 00:09 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 05 '25 00:11 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 21 '25 00:12 github-actions[bot]