Skip to content

Commit

Permalink
Make sure state machine functions are covered
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Jul 13, 2024
1 parent fb8cd65 commit 30b926e
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@
"null"
]
},
"ResultSelector": {
"type": "object"
},
"Retry": {
"items": {
"properties": {
Expand Down Expand Up @@ -653,6 +656,9 @@
"Comment": {
"type": "string"
},
"Credentials": {
"type": ["string", "object"]
},
"End": {
"enum": [
true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,85 @@ def rule():
},
[],
),
(
"Test functions",
{
"StartAt": "Task1",
"States": {
"Task1": {
"Type": "Task",
"Credentials": {
"Data": "input data",
"Algorithm": "SHA-1",
},
"Resource": "arn:aws:states:::batch:submitJob.sync",
"End": True,
},
},
},
[],
),
(
"Choices",
{
"StartAt": "ChoiceStateX",
"States": {
"ChoiceStateX": {
"Type": "Choice",
"Choices": [
{
"Not": {
"Variable": "$.type",
"StringEquals": "Private",
},
"Next": "Public",
},
{
"Variable": "$.value",
"NumericEquals": 0,
"Next": "ValueIsZero",
},
{
"And": [
{
"Variable": "$.value",
"NumericGreaterThanEquals": 20,
},
{"Variable": "$.value", "NumericLessThan": 30},
],
"Next": "ValueInTwenties",
},
{
"Variable": "$.value",
"NumericLessThan": 0,
"Next": "ValueIsNegative",
},
],
"Default": "DefaultState",
},
"Public": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:Foo",
"Next": "NextState",
},
"ValueIsZero": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:Zero",
"Next": "NextState",
},
"ValueInTwenties": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-east-1:123456789012:function:Bar",
"Next": "NextState",
},
"ValueIsNegative": {
"Type": "Succeed",
},
"DefaultState": {"Type": "Fail", "Cause": "No Matches!"},
},
},
[],
),
(
"Invalid configuration",
{
Expand Down

0 comments on commit 30b926e

Please sign in to comment.