-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[SFN] Add new TestState API capabilities #13418
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
Conversation
|
Currently, only patch changes are allowed on main. Your PR labels (aws:stepfunctions, semver: minor, docs: skip, notes: needed) indicate that it cannot be merged into the main at this time. |
2 similar comments
|
Currently, only patch changes are allowed on main. Your PR labels (aws:stepfunctions, semver: minor, docs: skip, notes: needed) indicate that it cannot be merged into the main at this time. |
|
Currently, only patch changes are allowed on main. Your PR labels (aws:stepfunctions, semver: minor, docs: skip, notes: needed) indicate that it cannot be merged into the main at this time. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 2h 41m 43s ⏱️ Results for commit 890ce8f. ♻️ This comment has been updated with latest results. |
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 2h 4m 41s ⏱️ + 3m 10s Results for commit 890ce8f. ± Comparison against base commit c5aa22c. This pull request removes 19 and adds 142 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
c61f3e1 to
7bf7ea6
Compare
Helper Script Tests34 tests 34 ✅ 0s ⏱️ Results for commit 7bf7ea6. |
S3 Image Test Results (AMD64 / ARM64) 2 files 2 suites 8m 17s ⏱️ Results for commit 7bf7ea6. |
7bf7ea6 to
c5d5aab
Compare
See https://aws.amazon.com/blogs/aws/accelerate-workflow-development-with-enhanced-local-testing-in-aws-step-functions/ for the overview of improvements. Rename `mocking` package to `local_mocking` Clearly mark mocking functionality related to Step Functions Local. This will help to distinguish between Local mocks and TestState mocks in the upcoming work. feat(sfn): Add StateName support Adds support for StateName parameter to TestState API. Extends TestStatePreprocessor and TestStateAmazonStateLanguageParser to accept an optional state_name parameter. This signals to the parse function that we should be parsing a full state machine (not just a single state), and also allows the preprocessor to construct a TestStateProgram using this state_name. Apply TestState mock to Task state result feat: Support mocked errors, Map states, and improve mock abstractions Adds support for mocking errors, map states, fixes inspection data population, improves mock abstractions, and adds a boatload more tests. Leverages new abstraction to improve the mocking/wrapping of states. Adds stateConfiguration tests. Adds support for mocked error types Supports adding inspection data both from preprocessor and during execution. feat(test_state): Support Catch and Retry fields Co-authored-by: Greg Furman <[email protected]>
Adds limited support for mocking a ContextObject in the SFN TestState API. Empty context case is not accounted for. Changes Uses pydantic (and some python magic) to validate that passed in context, and bubble up a validationexception. Reworks the inspectionData approach to instead patch each _eval_body and add appended results for a given key
5eb1f18 to
37ee009
Compare
Add test for the upcoming blog post scenario. Closes DRG-260. Adds new validated test. Also, adjusts validation for API Gateway Service Task state. Turns out that apigateway:invoke: has no equivalent in the AWS SDK service integration. Hence, the validation against botocore doesn't apply. A custom validation is needed for API Gateway Service Task state. Added a skip and TODO for now, to avoid failing validation.
gregfurman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
Motivation
New capabilities have recently been added to TestState API. This PR adds the following support for the new capabilities:
stateNameparameter.Changes
Add StateName support
Adds support for StateName parameter to TestState API. Extends TestStatePreprocessor and TestStateAmazonStateLanguageParser to accept an optional state_name parameter. This signals to the parse function that we should be parsing a full state machine (not just a single state), and also allows the preprocessor to construct a TestStateProgram using this state_name.
Apply TestState mock to Task state result
Support mocked errors, Map states, and improve mock abstractions Adds support for mocking errors, map states, fixes inspection data population, improves mock abstractions, and adds a boatload more tests. Leverages new abstraction to improve the mocking/wrapping of states. Adds stateConfiguration tests.
Adds support for mocked error types
Supports adding inspection data both from preprocessor and during execution.
Support Catch and Retry fields
Rename
mockingpackage tolocal_mockingClearly mark mocking functionality related to Step Functions Local. This will help to distinguish between Local mocks and TestState mocks in the upcoming work.
Adds support for field validation modes
Adds support for context object mocking
Tests
Related