This repository was archived by the owner on Mar 23, 2026. It is now read-only.
[SFN][TestState] Add validations for mock presence depending on state type#13457
Merged
[SFN][TestState] Add validations for mock presence depending on state type#13457
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 21m 58s ⏱️ - 1h 43m 16s Results for commit 1d472cb. ± Comparison against base commit 84bdd4a. This pull request removes 3401 and adds 8 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 39m 30s ⏱️ Results for commit 1d472cb. ♻️ This comment has been updated with latest results. |
66b9c53 to
11a0e42
Compare
gregfurman
approved these changes
Dec 4, 2025
Comment on lines
+104
to
+114
| if mock_input is None and isinstance(test_state, (StateMap, StateParallel)): | ||
| # This is a literal message when a Map or Parallel state is not accompanied by a mock in a test state request. | ||
| # The message is the same for both cases and is not parametrised anyhow. | ||
| raise InvalidDefinition( | ||
| "TestState API does not support Map or Parallel states. Supported state types include: [Task, Wait, Pass, Succeed, Fail, Choice]" | ||
| ) | ||
|
|
||
| if mock_input is not None and isinstance(test_state, (StatePass, StateFail, StateSucceed)): | ||
| raise ValidationException( | ||
| f"State type '{test_state.state_type.name}' is not supported when a mock is specified" | ||
| ) |
Contributor
There was a problem hiding this comment.
nit: Would be nice to return early here if mock_input exists.
i.e
if mock_input:
return
if isinstance(test_state, (StateMap, StateParallel)):
raise InvalidDefinition(...)
# ...
Contributor
Author
There was a problem hiding this comment.
Yeah, I'll be refactoring this code with the upcoming validations for mock contents, so this will change 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Add validations for mock presence depending on state type.
Closes DRG-310
Changes
Add validations:
Tests
Related