Skip to content

stepfunctions test_state data manipulation not correct - statemachine state #4683

@royassis

Description

@royassis

Describe the bug

When using the stepfunctions test_state function. If the tested state is of type state machine and using mock input. the test_state function fails the mock data passed to the function need to be changed from real world return values.

# Real state return values - fails
Output: object
StopDate: int
StartDate: int
Output: object
# The works
Output: string
StopDate: string
StartDate: string
Output: string

Changing the mock structure corrects this error but creates another one. The "Output" field in the state definition need to be changed:

From

"Output": "{% $merge([$states.result.Output, $states.input, {'h5ad_file':$states.result.Output.in_file}]) %}"

To:

"Output": "{% $merge([$parse($states.result.Output), $states.input, {'h5ad_file':$parse($states.result.Output).in_file}]) %}"

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

The data that the mock param recives should be exactly like the one the step function state returns

Current Behavior

None

Reproduction Steps

  1. Create a state definition of type - state machine execution.
  2. Get actual return values from a real state machine step
  3. Insert as mock values.

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.42.11

Environment details (OS name and version, etc.)

22.04.1-Ubuntu

Metadata

Metadata

Assignees

Labels

p3This is a minor priority issueservice-apiThis issue is caused by the service API, not the SDK implementation.stepfunctions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions